Re: [SQL] regarding grant option

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: AKHILESH GUPTA <akhilesh(dot)davim(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] regarding grant option
Date: 2006-03-01 22:12:33
Message-ID: 20060301221233.GV82012@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

Though, it is pretty easy to do something like:

select 'GRANT ALL ON ' || table_name || ' TO public;' from
information_schema.tables where table_schema='blah';

You can feed the output of that to psql, ei:

psql -qc "select 'GRANT ALL ON ' || table_name || ' TO public;' from
information_schema.tables where table_schema='blah'" | psql

On Wed, Mar 01, 2006 at 12:00:16PM -0300, Alvaro Herrera wrote:
> AKHILESH GUPTA wrote:
> > thank you very much sir for your valuable suggestion,
> > but i am talking about direct database query...........!
>
> There is none that can help you here, short of making a function in
> PL/pgSQL or other language ...
>
> > On 3/1/06, Alvaro Herrera <alvherre(at)commandprompt(dot)com> wrote:
> > >
> > > AKHILESH GUPTA wrote:
> > >
> > > > here i have to grant permissions to that user individually for each and
> > > > every table by using:
> > > > :->> grant ALL ON <tab_name> to <user_name>;
> > > > GRANT
> > > > and all the permissions are granted to that user for that particular
> > > table.
> > >
> > > Yes. If you are annoyed by having to type too many commands, you can
> > > write a little shell script to do it for you.
>
> --
> Alvaro Herrera http://www.CommandPrompt.com/
> The PostgreSQL Company - Command Prompt, Inc.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match
>

--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Browse pgsql-general by date

  From Date Subject
Next Message bfraci 2006-03-01 22:14:25 Re: Looking for a fix to index bloat
Previous Message bfraci 2006-03-01 22:10:07 Re: Looking for a fix to index bloat

Browse pgsql-sql by date

  From Date Subject
Next Message Jim C. Nasby 2006-03-01 22:15:18 Re: Replication - state of the art?
Previous Message Mark Dilger 2006-03-01 21:52:16 Re: [SQL] Interval subtracting