Can't remember where I found this but its worked in the past for
granting privileges to all tables in a DB to a user.
./psql -t -A -U $OWNER -W -c "select tablename from pg_tables
where tablename not like 'pg_%'" $mydatabase | xargs -i ./psql -U
$OWNER -W -c "grant ALL on {} to $NEWUSER" $mydatabase
--------------------------------------------------------------------------
Simon Fortelny
Research Technician
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N. D4-100
Seattle, WA 98109-1024
tel. 206.667.5618
email. sforteln@fred.fhcrc.org
On Wed, 16 Apr 2003, dudsen wrote:
> How do I GRANT an user privileges for all tables in an database with one
> command, as it is now i need to specify the name of each table.
> I want to write something like
> GRANT SELECT,INSERT ON mydatabase TO user; this doesn't work but are there a
> way of getting someting similar to work?
>
> --
> Daniel Udsen
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html
>