Re: GRANT on all tables? - Mailing list pgsql-admin

From Simon Fortelny
Subject Re: GRANT on all tables?
Date
Msg-id Pine.GSO.4.44.0304231247540.27528-100000@fred
Whole thread Raw
In response to GRANT on all tables?  (dudsen <dudsen@koen.dk>)
List pgsql-admin
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
>


pgsql-admin by date:

Previous
From: Steve Crawford
Date:
Subject: Re: Log Output Going to STDERR even with silent mode on
Next
From: "Gaetano Mendola"
Date:
Subject: News group