Re: dropping role w/dependent objects - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: dropping role w/dependent objects
Date
Msg-id 20070404225722.GI19251@alvh.no-ip.org
Whole thread Raw
In response to Re: dropping role w/dependent objects  ("Ed L." <pgsql@bluepolka.net>)
List pgsql-general
Ed L. wrote:
> On Wednesday April 4 2007 4:39 pm, Ed L. wrote:
> > On Wednesday April 4 2007 4:35 pm, Alvaro Herrera wrote:
> > > Note that you can give the objects owned by that role to
> > > someone else with REASSIGN OWNED, and drop the objects with
> > > DROP OWNED (note that they act differently regarding grants;
> > > see the docs)
> >
> > Yes, but how do identify what they are so that I know if I
> > want to DROP OWNED them?
>
> The REASSIGN OWNED appears to be insufficient:
>
> % psql -c "reassign owned by mygroup to mydba"
> REASSIGN OWNED
> % psql -c "drop group mygroup"
> ERROR:  role "mygroup" cannot be dropped because some objects
> depend on it
> DETAIL:  225 objects in this database

Right.  REASSIGN OWNED changes ownership to someone else, but leaves
grants untouched.  DROP OWNED revokes the permissions the role might
have.  This is the intended behavior.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: a couple of newbie question - deferrable, varchar vs text, 2 dbs
Next
From: Alvaro Herrera
Date:
Subject: Re: dropping role w/dependent objects