Re: Question about Privileges

From: John R Pierce <pierce(at)hogranch(dot)com>
To: Jack W <dbdevelop2000(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Question about Privileges
Date: 2009-03-12 22:45:27
Message-ID: 49B99087.1050506@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jack W wrote:
>
> I also find that if I only grant privileges on database to dbuser as
> below, without granting privileges on Schema and table to dbuser,
> dbuser still can not do SELECT on the tables.
> mydb=# grant all privileges on Database mydb to dbuser;
>
> Is there any simple way to grant All privileges to dbuser on all the
> 10 tables?

the simplest way is to make dbuser the OWNER of the database, and have
him create all the tables too, then he automatically has full rights to it.

there are also various scripts that can be used to enumerate objects and
grant specific privileges...

http://pgedit.com/public/sql/acl_admin/index.html
http://unf.be/postgresql/postgres_grant_all.perl
http://www.archonet.com/pgdocs/grant-all.html

in general, DATABASE privileges relate to connecting to that database,
and having the rights to create schemas in that database.

SCHEMA privileges grant the rights to connect to a schema, and
create/modify schemas

table/view/etc privileges grant the rights to select/insert/update/etc
the mentioned tables.

see http://www.postgresql.org/docs/current/static/sql-grant.html for
more specifics.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-03-12 23:03:31 Re: pg_standby error - can't find 00000001.history
Previous Message A.M. 2009-03-12 22:39:27 Re: nulls