Re: how drop a role that owns stuff ? - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: how drop a role that owns stuff ?
Date
Msg-id 20090713010456.GA6207@alvh.no-ip.org
Whole thread Raw
In response to how drop a role that owns stuff ?  (Andreas <maps.on@gmx.net>)
List pgsql-general
Andreas wrote:
> Hi,
> for some cleaning up I'd like to drop a certain role.
> Now DROP ROLE yields an error and complains about 271 objects being
> owned by this role.
>
> Is there an easy way to switch ownership of those objects to another role?

Yes, see REASSIGN OWNED (gives ownership to something else) and DROP
OWNED (drops grants and removes objects owned).  Normally you run both
in that order.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

pgsql-general by date:

Previous
From: Andreas
Date:
Subject: how drop a role that owns stuff ?
Next
From: Andreas
Date:
Subject: Design question: Should "postgres" own all the db objects?