Re: GRANT on database - Mailing list pgsql-general

From will trillich
Subject Re: GRANT on database
Date
Msg-id 20010305124145.B19295@mail.serensoft.com
Whole thread Raw
In response to GRANT on database  (Boulat Khakimov <boulat@inet-interactif.com>)
Responses Unknown Response Type???
List 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@serensoft.com
http://groups.yahoo.com/group/newbieDoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

pgsql-general by date:

Previous
From: Boulat Khakimov
Date:
Subject: GRANT on database
Next
From: will trillich
Date:
Subject: Re: Re: With which user Apache accesses PostgreSQL