My first revoke

Started by A Bover 17 years ago3 messagesgeneral
Jump to latest
#1A B
gentosaker@gmail.com

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?

#2Fernando Moreno
azazel.7@gmail.com
In reply to: A B (#1)
Re: My first revoke

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;

In reply to: Fernando Moreno (#2)
Re: My first revoke

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
------------------------------------------------------------------