Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2002
    Location
    Germany, Münster
    Posts
    1

    Unanswered: user administration

    Hi everybody,

    I am new in this forum, so I like to introduce myself at first: My name is Claus and I am a webdeveloper. In the last time a made experience with the database mysql.

    For a new job I have to use postgresql, and now I have some trouble with the user administration.

    From mysql I am used to grant or revoke permissions for a hole database (grant select on db.table ...), with postgresql it seems, that this only works for tables.

    In the file pg_hba.conf I found a way to revoke permissions for a hole database depending on an IP, but there seems to be no way to do this for single user.

    tia

    Claus

  2. #2
    Join Date
    Sep 2001
    Location
    Vienna
    Posts
    400

    pg_hba.conf

    you can do this in pg_hba.conf.

    You must enter an AUTH_TYPE
    password,md5,...

    But there is no thing like give all access to the user to this database.

    You can only chosse the authentification type and you must submit wiht the connection string the user and password

    this should to the thing
    http://www.postgresql.org
    --Postgresql is the only kind of thing--

  3. #3
    Join Date
    Aug 2002
    Location
    Germany
    Posts
    17

    Smile Re: user administration

    Hi,

    the only way I found to restrikt databaseaccess on a per/user base when you cant distinguish them on the network connection (e.g. on a webserver with mutliple virtual domains) is to create a userfile for each database and link them in the pg_hba.conf like this:


    host UsrAsDB 127.0.0.1 255.255.255.255 password useraspwdfile
    host UsrBsDB 127.0.0.1 255.255.255.255 password userbspwdfile

    Note, that you have to remove any trustet access methods.

    To create the passwdfiles use
    pg_passwd passwordfile
    and add those users that should have access to this db.

    Hope this helps.

    Greetings
    Andreas

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •