PDA

View Full Version : user administration


Claus
07-12-02, 10:37
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

eperich
07-13-02, 08:30
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

sassermann
08-23-02, 05:24
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:) :)