Re: Grant on several tables at once

From: Rajesh Kumar Mallah <mallah(at)trade-india(dot)com>
To: MaRcElO PeReIrA <gandalf_mp(at)yahoo(dot)com(dot)br>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Grant on several tables at once
Date: 2003-08-01 20:15:20
Message-ID: 3F2ACA58.4050004@trade-india.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin


if its possible to generate the list of tables
from a sql query then do something like

\o out.sql
select ' grant select on table1 to ' || tablename || ' ;' ;
\i out.sql

regds
mallah.

MaRcElO PeReIrA wrote:

> Hello All,
>
> I have a database that contain 72 tables. How can I grant "SELECT" on
> all those 72 tables to a user, at once?
>
> I use to do:
>
> # grant select on table1 to marcelo;
> # grant select on table2 to marcelo;
> # ...
> # grant select on table72 to marcelo;
>
> but it is a lot of tables... I would like to do this at once!
>
> Thanks in advance and
> Best Regards,
>
> Marcelo
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message sforteln 2003-08-01 21:13:43 Re: Grant on several tables at once
Previous Message Andreas Pflug 2003-08-01 20:14:55 Re: Grant on several tables at once