Re: forcing table ownership - Mailing list pgsql-general

From Richard Huxton
Subject Re: forcing table ownership
Date
Msg-id 4E7354F2.3010806@archonet.com
Whole thread Raw
In response to Re: forcing table ownership  ("Darin Perusich" <Darin.Perusich@ctg.com>)
Responses Re: forcing table ownership
List pgsql-general
On 16/09/11 14:13, Darin Perusich wrote:
>
> Altering the table owner by setting it to the group role effectively
> denies permission to all users of the group. Unless they explicitly "SET
> role grp1" that is.

I've already got a user "richardh"

As a superuser:
   CREATE GROUP mygroup INHERIT;
   GRANT mygroup TO richardh;
   CREATE TABLE shared_table (i int);
As richardh:
   ALTER TABLE shared_table ADD COLUMN t text;
   ERROR:  must be owner of relation shared_table
As superuser:
   ALTER TABLE shared_table OWNER TO mygroup;
As richardh:
   ALTER TABLE shared_table ADD COLUMN t text;
   ALTER TABLE

I think the key bit you're missing is the "INHERIT" on the group. Also
note that the CREATE USER/CREATE GROUP commands actually just run CREATE
ROLE under the hood.

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Josh Kupershmidt
Date:
Subject: Re: What do you like to get ?
Next
From: "Marc Mamin"
Date:
Subject: Re: What do you like to get ?