Thread: Granting Permissions to User To Access Database

Granting Permissions to User To Access Database

From
"Kevin Schachter"
Date:
I recently installed Postgres on my server to rid of the horrible
limitations of Mysql. However I am having some trouble setting up
permissions as they are in MySQL.

In MySQL you can grant a user select permissions to all tables in a database
with the command "GRANT select on db.* to .....". Is there a similar way to
accomplish this in Postgres? Reading up on GRANT I see that it only works
for individual tables and not a full database.

As well, how can I restrict a user to only one database. In pg_hba.conf
there is nothing that specifies the user name. I can grant access to the
database to all users on an ip, but I can't grant it to only one user.

Thanks in advance,

Kevin


Re: Granting Permissions to User To Access Database

From
"Anthony E . Greene"
Date:
On Sat, 06 Jan 2001 15:22:46 Kevin Schachter wrote:
>In MySQL you can grant a user select permissions to all tables in a
>database
>with the command "GRANT select on db.* to .....". Is there a similar way to
>accomplish this in Postgres? Reading up on GRANT I see that it only works
>for individual tables and not a full database.

The docs are correct on this -- you have to do it per table.

--
Anthony E. Greene <agreene@pobox.com> <http://www.pobox.com/~agreene/>
PGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26  C484 A42A 60DD 6C94 239D
Chat:  AOL/Yahoo: TonyG05    ICQ: 91183266
Linux. The choice of a GNU Generation. <http://www.linux.org/>