Re: [GENERAL] Re: Permissons on database

From: Louis-David Mitterrand <vindex(at)apartia(dot)ch>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: [GENERAL] Re: Permissons on database
Date: 2001-04-08 09:10:06
Message-ID: 20010408111006.A488@apartia.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-novice pgsql-sql

On Wed, Mar 07, 2001 at 03:40:44PM -0500, Roland Roberts wrote:
> >>>>> "bk" == Boulat Khakimov <boulat(at)inet-interactif(dot)com> writes:
>
> bk> How do I grant permissions on everything in the selected
> bk> databes?
>
> bk> GRANT doesnt take as on object database name nor does it
> bk> accept wild chars....
>
> Attached is some Perl code I wrote long ago to do this. This
> particular code was done for Keystone, a problem tracking database and
> it would do a "GRANT ALL". Modify it as needed. Last I checked it
> worked with both PostgreSQL 6.5.x and 7.0.x

A simple two-line shell script to apply any command to a list of tables:

for i in `psql mydatabase -c '\dt' -P tuples_only | cut -f2 -d ' '`
do psql mydatabase -c "grant all on $i to public"; done

>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://www.postgresql.org/search.mpl

These mailing list footers really suck. Please consider removing them.
They reflect poorly on the general level of the pgsql-* lists. Instead
do send a one-time "welcome" message containing all your "tips" when
people subscribe to a list.

Probably a lost cause but the subject mangling [GENERAL], [HACKERS] etc.
(especially that one! a "hacker" should know how to filter his mail)
really sucks too.

Educate, don't stoop. Even Outlook Express has great filtering
capabilities which don't require any subject mangling.

--
slashdot: I miss my free time, Rob.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joel Burton 2001-04-08 09:26:33 Re: converting from php3 to php4
Previous Message Mario Weilguni 2001-04-08 08:35:00 strange query plan

Browse pgsql-novice by date

  From Date Subject
Next Message Joel Burton 2001-04-08 09:34:48 Re: replacing tables
Previous Message Atul 2001-04-07 06:19:31 Query

Browse pgsql-sql by date

  From Date Subject
Next Message Louis-David Mitterrand 2001-04-08 09:36:38 Re: Maybe a Bug, maybe bad SQL
Previous Message Josh Berkus 2001-04-07 21:09:06 Need help with EXECUTE function