Re: How to grant a user read-only access to a database? - Mailing list pgsql-general

From Thom Brown
Subject Re: How to grant a user read-only access to a database?
Date
Msg-id bddc86151003020327j45d327a0pc1cb97d81ecdffe7@mail.gmail.com
Whole thread Raw
In response to How to grant a user read-only access to a database?  (Antonio Goméz Soto<antonio.gomez.soto@gmail.com>)
Responses Re: How to grant a user read-only access to a database?  (Nilesh Govindarajan <lists@itech7.com>)
List pgsql-general
On 2 March 2010 11:12, Antonio Goméz Soto <antonio.gomez.soto@gmail.com> wrote:
> Hi,
>
> I tried this:
>
> names=# grant select on database names to spice;
> ERROR:  invalid privilege type SELECT for database
>
> The documentation seems to imply I need to grant SELECT
> to each table separately. That's a lot of work, and what if
> new tables are created?
>
> Thanks,
> Antonio
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

The privileges you can grant on a database are only related to the
creation of tables and connecting to that database.

You could create a role which has SELECT-only access, apply that role
to all your tables, and assign users (other roles) as members of that
role.

Regards

Thom

pgsql-general by date:

Previous
From: Antonio Goméz Soto
Date:
Subject: How to grant a user read-only access to a database?
Next
From: Nilesh Govindarajan
Date:
Subject: Re: How to grant a user read-only access to a database?