Re: Grant on several tables at once - Mailing list pgsql-admin

From Rajesh Kumar Mallah
Subject Re: Grant on several tables at once
Date
Msg-id 3F2ACA58.4050004@trade-india.com
Whole thread Raw
In response to Grant on several tables at once  (MaRcElO PeReIrA <gandalf_mp@yahoo.com.br>)
Responses Re: Grant on several tables at once  (Ang Chin Han <angch@bytecraft.com.my>)
List 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




pgsql-admin by date:

Previous
From: MaRcElO PeReIrA
Date:
Subject: Grant on several tables at once
Next
From: Andreas Pflug
Date:
Subject: Re: Grant on several tables at once