granting privileges

Lists: pgsql-general
From: Nageshwar Rao <NageshwarR(at)PLANETASIA(dot)COM>
To: pgsql-general(at)postgresql(dot)org
Subject: granting privileges
Date: 2004-12-01 05:36:03
Message-ID: 5F4ED4205E00D6119BFE009027DE39090793EF9D@MLSW00103
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

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 .


From: "Najib Abi Fadel" <nabifadel(at)usj(dot)edu(dot)lb>
To: "Nageshwar Rao" <NageshwarR(at)PLANETASIA(dot)COM>
Cc: "generalpost" <pgsql-general(at)postgresql(dot)org>
Subject: Re: granting privileges
Date: 2004-12-01 08:45:33
Message-ID: 004a01c4d782$4e35de50$f664a8c0@najib
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

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(at)postgresql(dot)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 .