Re: Default permissions for CREATE SCHEMA/TABLE?

From: "David Johnston" <polobo(at)yahoo(dot)com>
To: "'Stephen Frost'" <sfrost(at)snowman(dot)net>, "'Yang Zhang'" <yanghatespam(at)gmail(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Default permissions for CREATE SCHEMA/TABLE?
Date: 2011-03-24 22:17:18
Message-ID: 015101cbea71$3d0e6a30$b72b3e90$@yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Keep in mind if you want to alter the GLOBAL privileges (i.e., the defaults)
granted via PUBLIC you MUST NOT specify a schema.

From what I can tell there is no way to associate a default owner different
that the one executing the CREATE statement (though some inheritance cases
do arise IIRC).

David J.

-----Original Message-----
From: pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Stephen Frost
Sent: Thursday, March 24, 2011 4:56 PM
To: Yang Zhang
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Default permissions for CREATE SCHEMA/TABLE?

* Yang Zhang (yanghatespam(at)gmail(dot)com) wrote:
> Any way I can have all newly created schemas/tables be owned by, or
> have all permissions granted to, a certain group, without having to
> remember to GRANT ALL ON [SCHEMA|TABLE] TO that group? Thanks in
> advance.

ALTER DEFAULT PRIVILEGES FOR ROLE my_user IN SCHEMA my_schema GRANT SELECT
ON TABLES TO other_role;

http://www.postgresql.org/docs/9.0/static/sql-alterdefaultprivileges.html

Thanks,

Stephen

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrej 2011-03-24 23:17:38 Re: Is Postgres 9 supported on Ubuntu Desktop10LTS?
Previous Message Sven Haag 2011-03-24 21:49:22 Re: Recursive function that receives a list of IDs and returns all child IDs