From: Simon Fortelny <sforteln@fhcrc.org>
To: dudsen <dudsen@koen.dk>
Cc: pgsql-admin@postgresql.org
Subject: Re: GRANT on all tables?
Date: Wed, 23 Apr 2003 12:48:55 -0700 (PDT)
Message-ID: <Pine.GSO.4.44.0304231247540.27528-100000@fred> (raw)
In-Reply-To: <1050499026.680723@kalvebod.groenjord.dk>
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
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: sforteln@fhcrc.org, dudsen@koen.dk
Subject: Re: GRANT on all tables?
In-Reply-To: <Pine.GSO.4.44.0304231247540.27528-100000@fred>
References: <1050499026.680723@kalvebod.groenjord.dk> <Pine.GSO.4.44.0304231247540.27528-100000@fred>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox