Re: How to GRANT rights to modify a table ??? - Mailing list pgsql-general

From Tom Lane
Subject Re: How to GRANT rights to modify a table ???
Date
Msg-id 7892.1252775922@sss.pgh.pa.us
Whole thread Raw
In response to Re: How to GRANT rights to modify a table ???  (Denis BUCHER <dbucherml@hsolutions.ch>)
List pgsql-general
Denis BUCHER <dbucherml@hsolutions.ch> writes:
> Tom Lane a �crit :
>> What might be more practical is to create a group role that actually
>> owns the table, and make everyone who needs to do this sort of thing
>> a member of that group.

> It's strange but after having tried it, it doesn't work ?

Hmm, worksforme:

regression=# create table t1 (f1 int);
CREATE TABLE
regression=# create role t1o ;
CREATE ROLE
regression=# alter table t1 owner to t1o;
ALTER TABLE
regression=# create user joe;
CREATE ROLE
regression=# grant t1o to joe;
GRANT ROLE
regression=# \c - joe
psql (8.5devel)
You are now connected to database "regression" as user "joe".
regression=> alter table t1 add column f2 int;
ALTER TABLE
regression=>

One possibility is that your "mycolleague" user is set up without the
INHERIT property, in which case he'd have to do "SET ROLE tableowner"
to acquire the ownership privilege.  (tableowner's INHERIT setting
is not the relevant thing here; mycolleague's is.)

            regards, tom lane

pgsql-general by date:

Previous
From: Denis BUCHER
Date:
Subject: Re: How to GRANT rights to modify a table ???
Next
From: Merlin Moncure
Date:
Subject: Re: primary keys