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 16:44:50
Message-ID: 4AABD002.7050901@hsolutions.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane a écrit :
>>> 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

That's great, in fact this is the right solution, I didn't think about
it... Thanks a lot...

Denis

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-09-12 16:46:03 Re: primary keys
Previous Message Grant Maxwell 2009-09-12 16:35:02 primary keys