How to GRANT SELECT on all tables?

From: <kynn(at)panix(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: How to GRANT SELECT on all tables?
Date: 2006-01-31 21:10:47
Message-ID: 200601312110.k0VLAls24255@panix3.panix.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

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

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2006-01-31 21:45:30 Re: How to GRANT SELECT on all tables?
Previous Message Ketema J. Harris 2006-01-31 20:52:37 variables outside of functions