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

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Denis BUCHER <dbucherml(at)hsolutions(dot)ch>
Cc: PostgreSQL - General ML <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to GRANT rights to modify a table ???
Date: 2009-09-12 15:48:49
Message-ID: 4AABC2E1.8060706@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 12/09/2009 16:44, Denis BUCHER wrote:
> Hello,
>
> A very annoying problem with Postgres is the following one :
>
> As postgres user, I give all rights to all objects of a database or
> schema to a colleague :
> GRANT ALL ON mytable TO mycolleague;
>
> But when he tries to modify something, even something really small like
> adding a column to a table :
> ALTER TABLE mytable ADD COLUMN field integer;
> 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;

- I forget the exact syntax, but it'll be in the docs.

Ray.

------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod(at)iol(dot)ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-09-12 16:00:36 Re: How to GRANT rights to modify a table ???
Previous Message Denis BUCHER 2009-09-12 15:44:37 How to GRANT rights to modify a table ???