Grant on Database? - Mailing list pgsql-general

From David Wheeler
Subject Grant on Database?
Date
Msg-id Pine.LNX.4.21.0102201656180.14743-100000@theory
Whole thread Raw
List pgsql-general
Hey All,

We have a need to grant privileges on entire databases to users and/or
groups. It looks like GRANT just grants on tables and sequences, but I'd
like to know if there's a more direct way to do it. What I'm doing now
is getting a list of tables and sequences and calling grant for each one
in turn. How am I getting this list (I'm user Perl, not psql)? With this
query:

        SELECT relname
        FROM   pg_class
        WHERE  relkind IN ('r', 'S')
               AND relowner IN (
                   SELECT usesysid
                   FROM   pg_user
                   WHERE  LOWER(usename) = 'myuser')

Anyway, pointers to any shortcuts for this would be greatly appreciated.

Thanks,

David

--
David Wheeler
Software Engineer
Creation Engines, Inc.                             ICQ:   15726394
david@creationengines.com                          AIM:   dwTheory


pgsql-general by date:

Previous
From: Joseph Shraibman
Date:
Subject: Re: Weird indices
Next
From: Tom Lane
Date:
Subject: Re: Weird indices