Re: How to GRANT rights to modify a table ???

From: Denis BUCHER <dbucherml(at)hsolutions(dot)ch>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: rod(at)iol(dot)ie, PostgreSQL - General ML <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to GRANT rights to modify a table ???
Date: 2009-09-12 17:10:16
Message-ID: 4AABD5F8.2060706@hsolutions.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

Tom Lane a écrit :
> "Raymond O'Donnell" <rod(at)iol(dot)ie> writes:
>> On 12/09/2009 16:44, Denis BUCHER wrote:
>>> ERROR: must be the owner of the mytable relation
>
>> The clue is in the error message :-) .... GRANTing ALL doesn't make them
>> the owner of the object as well.
>
>> For that, you have to do something like
>> ALTER TABLE mytable OWNER TO mycolleague;
>
> 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.
>
> CREATE ROLE mytable_owner;
> ALTER TABLE mytable OWNER TO mytable_owner;
> GRANT mytable_owner TO myself, mycolleague, ... ;
>
> I highly recommend reading the GRANT command reference page.
>
> regards, tom lane

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

pg_dump says :

CREATE ROLE tableowner;
ALTER ROLE tableowner WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB
NOLOGIN;
GRANT tableowner TO mycolleague GRANTED BY postgres;
GRANT tableowner TO postgres GRANTED BY postgres;

My table seems to be correct :

bw_rma=# \dt abc.testtable
Liste des relations
Schéma | Nom | Type | Propriétaire
--------+------------+-------+--------------
abc | testtable | table | tableowner
(1 ligne)

When I login as "mycolleague" :
ALTER TABLE abc.testtable ADD COLUMN field integer;

What is wrong in what I do ?

Thanks a lot for any help...

Denis

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Denis BUCHER 2009-09-12 17:17:08 Re: How to GRANT rights to modify a table ???
Previous Message Grant Maxwell 2009-09-12 16:53:18 Re: primary keys