Re: GRANT on database

From: will trillich <will(at)serensoft(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: GRANT on database
Date: 2001-03-05 18:41:45
Message-ID: 20010305124145.B19295@mail.serensoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Mar 05, 2001 at 01:30:01PM -0500, Boulat Khakimov wrote:
> Hi,
>
> How do I grant all on database TO PUBLIC?
> Without having to go through each table in that database?
>
> Basically I have created a databases as one user, and I want another
> user
> to be able to access all tables in that database. However
> when i run simple query like "SELECT * from tablename" as that "other
> user"
> it gives me (ERROR: tablename: Permission denied).
>
> GRANT doesnt let you grant access to the entire databases , only tables.
> and since I have over 30 tables in my DB goin through each table and
> setting
> permissions by hand is too time consuming.

<guessing>

i'd
\o mytables.sql
select tablename from pg_tables where tableowner='whoever';
then edit the file to create grant statements, and then
\i mytables.sql
and be done with it...

(sure would be nice if we could
grant select to public on
(select tablename from pg_tables where tableowner='whoever');
but i don't think that'll work.)
</guessing>

--
It is always hazardous to ask "Why?" in science, but it is often
interesting to do so just the same.
-- Isaac Asimov, 'The Genetic Code'

will(at)serensoft(dot)com
http://groups.yahoo.com/group/newbieDoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message chris markiewicz 2001-03-05 19:09:26 Unknown Response Type???
Previous Message will trillich 2001-03-05 18:32:36 Re: Re: With which user Apache accesses PostgreSQL