Granting read-only access to an existing database?

From: "Eric Jain" <eric(dot)jain(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Granting read-only access to an existing database?
Date: 2008-11-14 00:24:11
Message-ID: e48479d40811131624u409c8939g972c3a9a4523868d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

What's the simplest way to grant read-only access to an existing
database? One approach I guess would be to create a user who has
SELECT but not INSERT etc privileges. But it appears that GRANT SELECT
does not work at the schema or database level. This means I'd not only
have to create hundreds of GRANT statements, but also remember to
issue an additional GRANT whenever a new table is created!

I came across some PL/pgSQL procedures for doing batch GRANTs, but
they appear to be outdated (i.e. don't work with 8.3) and are "run at
your own risk". There was also mention that pgAdmin had a function to
batch GRANTs, but I couldn't find any such thing in the current
version...

Any other ideas?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2008-11-14 00:30:18 Re: vacuum output question
Previous Message Alvaro Herrera 2008-11-13 23:58:31 Re: Fwd: Tweaking PG (again)