pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Louis-David Mitterrand <vindex@apartia.ch>
To: pgsql-sql@postgresql.org
Subject: Re: [GENERAL] Re: Permissons on database
Date: Sun, 8 Apr 2001 11:10:06 +0200
Message-ID: <20010408111006.A488@apartia.ch> (raw)
In-Reply-To: <m2puftmhwz.fsf@tycho.rlent.pnet>
References: <3AA517BE.31EEE461@inet-interactif.com>
	<m2puftmhwz.fsf@tycho.rlent.pnet>

On Wed, Mar 07, 2001 at 03:40:44PM -0500, Roland Roberts wrote:
> >>>>> "bk" == Boulat Khakimov <boulat@inet-interactif.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.



view thread (6+ messages)

Message-ID: <20010408111006.A488@apartia.ch>
Permalink:  ../20010408111006.A488@apartia.ch/
Also on:    postgresql.org/message-id/20010408111006.A488@apartia.ch

 · 

reply

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-sql@postgresql.org
  Cc: vindex@apartia.ch
  Subject: Re: [GENERAL] Re: Permissons on database
  In-Reply-To: <20010408111006.A488@apartia.ch>
  References: <3AA517BE.31EEE461@inet-interactif.com> <m2puftmhwz.fsf@tycho.rlent.pnet> <20010408111006.A488@apartia.ch>

* 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