Re: how drop a role that owns stuff ?

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Andreas <maps(dot)on(at)gmx(dot)net>
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: how drop a role that owns stuff ?
Date: 2009-07-13 01:04:56
Message-ID: 20090713010456.GA6207@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andreas 2009-07-13 01:10:49 Design question: Should "postgres" own all the db objects?
Previous Message Andreas 2009-07-13 01:01:56 how drop a role that owns stuff ?