granting privileges

Started by Nageshwar Raoover 21 years ago2 messagesgeneral
Jump to latest
#1Nageshwar Rao
NageshwarR@PLANETASIA.COM

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 .

#2Najib Abi Fadel
nabifadel@usj.edu.lb
In reply to: Nageshwar Rao (#1)
Re: granting privileges

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 -----
From: Nageshwar Rao
To: pgsql-general@postgresql.org
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 .