Thread: User based access
Hi all, Would I be correct in saying that there is no way to allow a few users to have access to a database, but deny others, under Postgresql? I have scoured the documentation (which draws a blank) and have looked through other similar questions to this mailing list (which all seem to have gone unanswered). I'm not having any problems creating users, or using the pg_hba.conf - all I want to do is prevent some postgres users from accessing certain databases... Cheers, Paul. -- Paul Dwerryhouse paul@xenu.ee.mu.oz.au "The growing use of e-mail, not to mention Web-page publishing, threatens to reverse the trend towards illiteracy among the supposedly educated without at the same time improving their spelling". -- Michael Swaine, Dr. Dobb's Journal
> > Hi all, > > Would I be correct in saying that there is no way to allow a few users to > have access to a database, but deny others, under Postgresql? > > I have scoured the documentation (which draws a blank) and have looked > through other similar questions to this mailing list (which all seem to > have gone unanswered). > > I'm not having any problems creating users, or using the pg_hba.conf - > all I want to do is prevent some postgres users from accessing certain > databases... hba_conf has that ability. -- Bruce Momjian | http://www.op.net/~candle maillist@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026
On this same note, can you restrict a certain user to just read-only and allow others to have write access to certain tables. If so, how would I go about this? Thanks ----------------------------------------------------- ///////////// Gregg Berkholtz - Owner/Consultant | G B | PC, Novell, and Linux Support/Sales | Computers | info: www.gbcomputers.com \\\\\\\\\\\\\ Paul Dwerryhouse wrote: > Hi all, > > Would I be correct in saying that there is no way to allow a few users to > have access to a database, but deny others, under Postgresql? > > I have scoured the documentation (which draws a blank) and have looked > through other similar questions to this mailing list (which all seem to > have gone unanswered). > > I'm not having any problems creating users, or using the pg_hba.conf - > all I want to do is prevent some postgres users from accessing certain > databases... > > Cheers, > > Paul. > > -- > Paul Dwerryhouse paul@xenu.ee.mu.oz.au > "The growing use of e-mail, not to mention Web-page publishing, threatens to > reverse the trend towards illiteracy among the supposedly educated without at > the same time improving their spelling". -- Michael Swaine, Dr. Dobb's Journal --
Hi, You need to look at the GRANT and REVOKE commands in the SQL documentation. e.g. to allow harold read-only on table contacts command (run by table owner) would be similar to: REVOKE all ON contacts FROM harold; GRANT select ON contacts TO harold; and to deny a user access to a table just REVOKE all the privileges from them. Regards, Neil > -----Original Message----- > From: owner-pgsql-admin@postgreSQL.org > [mailto:owner-pgsql-admin@postgreSQL.org]On Behalf Of Gregg Berkholtz > Sent: 08 January 1999 07:52 > To: Paul Dwerryhouse > Cc: pgsql-admin@postgreSQL.org > Subject: Re: [ADMIN] User based access > > > On this same note, can you restrict a certain user to just > read-only and allow > others to have write access to certain tables. If so, how would I > go about this? > Paul Dwerryhouse wrote: > > > Hi all, > > > > Would I be correct in saying that there is no way to allow a > few users to > > have access to a database, but deny others, under Postgresql? > >