Skip site navigation (1) Skip section navigation (2)

Re: How to GRANT SELECT on all tables?

From: "Kevin Crenshaw" <kcrenshaw(at)viscient(dot)com>
To: <kynn(at)panix(dot)com>,<pgsql-novice(at)postgresql(dot)org>
Subject: Re: How to GRANT SELECT on all tables?
Date: 2006-01-31 22:37:21
Message-ID: 20060131223721.375CD9DCA64@postgresql.org (view raw or flat)
Thread:
Lists: pgsql-novice
One way to accomplish this is to create an SQL script to grant privileges to
all of your tables one at a time.  Then you would simple have to start up a
psql session and enter: \i sqlscriptname.sql;

HTH,

Kevin 

 

-----Original Message-----
From: pgsql-novice-owner(at)postgresql(dot)org
[mailto:pgsql-novice-owner(at)postgresql(dot)org] On Behalf Of kynn(at)panix(dot)com
Sent: Tuesday, January 31, 2006 4:11 PM
To: pgsql-novice(at)postgresql(dot)org
Subject: [NOVICE] How to GRANT SELECT on all tables?





Another noobish question.

I'm looking for the "moral equivalent" of the mythical

  GRANT SELECT ON TABLE * TO PUBLIC

I.e. I'm looking for a way to grant SELECT privileges to PUBLIC on all
the tables, without having to specify all the table names.

Naively, I tried the subquery approach

  GRANT SELECT
    ON TABLE (SELECT tablename FROM pg_tables WHERE schemaname='public')
    TO PUBLIC

but this failed too.

Thanks!

kj


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq


In response to

pgsql-novice by date

Next:From: Christoph Della ValleDate: 2006-02-01 06:39:52
Subject: Re: How to GRANT SELECT on all tables?
Previous:From: Tom LaneDate: 2006-01-31 21:45:30
Subject: Re: How to GRANT SELECT on all tables?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group