Thread: granting privileges

granting privileges

From
Nageshwar Rao
Date:

How to grant privileges to all objects( tables,sequences etc) in specific schema, I mean I want to give users select,insert,delete and update to all objects in the schema in one sql statement.I know

 

Grant select,insert,update,delete on table_name to user_name.  But this is for individual table .

Re: granting privileges

From
"Najib Abi Fadel"
Date:
Hi Nageshwar try this command i think it's what you need.
 
psql -t -d DataBaseName -c "select tablename from pg_tables where schemaname='theSchemaName' " | xargs -i  psql -t -d DataBaseName -c "grant select on {} to nabifadel"
 
 
Najib.
Programmer at Saint-Joseph University
Lebanon
 
 
----- Original Message -----
Sent: Wednesday, December 01, 2004 7:36 AM
Subject: [GENERAL] granting privileges

How to grant privileges to all objects( tables,sequences etc) in specific schema, I mean I want to give users select,insert,delete and update to all objects in the schema in one sql statement.I know

 

Grant select,insert,update,delete on table_name to user_name.  But this is for individual table .