Re: read only user

From: "Tomeh, Husam" <htomeh(at)firstam(dot)com>
To: "Colin Taylor" <colin(dot)taylor(at)gmail(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: read only user
Date: 2005-11-11 23:35:51
Message-ID: CB0FB369FF86E248A884BCC002562BCB19ACB0@pisgsna01sxch01.ana.firstamdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

As a workaround, you can run this in psql :

select 'grant select on ' || tablename || ' to ' || 'smith ;'
from pg_tables where schemaname='public';

The above SQL will generate the DDL for all the tables in the schema
"public" for instance.

You may want to direct your output which may be something like :

grant select on table1 to smith ;
grant select on table2 to smith ;
grant select on foo to smith ;

to a file and then run the file in psql to execute the grant statements.

--
Husam

________________________________

From: pgsql-admin-owner(at)postgresql(dot)org
[mailto:pgsql-admin-owner(at)postgresql(dot)org] On Behalf Of Colin Taylor
Sent: Sunday, November 06, 2005 1:54 PM
To: pgsql-admin(at)postgresql(dot)org
Subject: [ADMIN] read only user

Hi there, Ive google and searched the lists but havent found detailed
instructions on how to give a user readly access to a schema. Is there a
way to do this with out explictly granting the SELECT privilege on every
table?

Thanks and regards,
Colin.

**********************************************************************
This message contains confidential information intended only for the
use of the addressee(s) named above and may contain information that
is legally privileged. If you are not the addressee, or the person
responsible for delivering it to the addressee, you are hereby
notified that reading, disseminating, distributing or copying this
message is strictly prohibited. If you have received this message by
mistake, please immediately notify us by replying to the message and
delete the original message immediately thereafter.

Thank you. FADLD Tag
**********************************************************************

Browse pgsql-admin by date

  From Date Subject
Next Message Alvaro Herrera 2005-11-13 19:05:53 Re: autovacuum on updated rows
Previous Message Stephen Byers 2005-11-11 21:05:20 Re: autovacuum on updated rows