automatical grant - role membership

From: Petr Suk <petrxsuk(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: automatical grant - role membership
Date: 2013-11-13 15:26:48
Message-ID: CA+yMuNq+unyKgCrpfmmb2WK0=toMzqrx7491n=upM8Rrj3KtwQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi,
I am trying to avoid neediness of manual settings of privileges for new
tables and views for roles in the same membership.
Let's say I have one DB schema (myschema) and two DB users (roles: role1,
role2). "Role1" and "role2" are in mebership of role "mygroup".
I want my DB to work like this:
"role1" create some table in "myschema" and is the owner of this table. I
want "role2" to automatically have all privileges on this table.
I was trying to use ALTER DEFAULT PRIVILEGES, but I still don't have what I
need.
#
ALTER DEFAULT PRIVILEGES IN SCHEMA myschema GRANT ALL ON TABLES TO mygroup;
#
Please, am I missing something? I am using PostgreSQL 9.1

Thanks a lot.
Petr

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Luca Ferrari 2013-11-14 07:25:31 Re: automatical grant - role membership
Previous Message Scott Ribe 2013-11-13 14:27:34 Re: REVOKE command not working as expected