Thread: My first revoke

My first revoke

From
"A B"
Date:
So I have created a role

create role my_role   with NOSUPERUSER NOCREATEDB NOCREATEROLE  LOGIN
ENCRYPTED PASSWORD 'secret';

Now I wish to grant only select for this role on some tables.

So I do

revoke all privileges on table  X  from my_role;

and i do this for all my tables (X is table name) ?

and then

grant select on table X to my_role;

for all tables?

Re: My first revoke

From
"Fernando Moreno"
Date:
Hi, first of all, a new role doesn't have any privilege on any table (every type of database object has different default privileges), so you only have to grant select on the tables you want, and yes, one by one.

You can also grant or revoke privileges this way: grant select on table1,table2,table3...tableN to my_role;

Re: My first revoke

From
Raymond O'Donnell
Date:
On 25/09/2008 19:24, Fernando Moreno wrote:
> only have to grant select on the tables you want, and yes, one by one.

If you use pgAdmin, it has a wizard for doing a bunch of objects in one go.

Ray.


------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------