Re: dropping role w/dependent objects

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: "Ed L(dot)" <pgsql(at)bluepolka(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: dropping role w/dependent objects
Date: 2007-04-04 22:35:30
Message-ID: 20070404223530.GG19251@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-patches

Ed L. wrote:
> This is pgsql 8.2.3:
>
> % psql -c "drop role mygroup"
> ERROR: role "mygroup" cannot be dropped because some objects
> depend on it
> DETAIL: 227 objects in this database
>
> How do I identify what these dependent objects are?

Hum, this seems to be a bug. The objects are supposed to be logged in
the DETAIL field of that error, but when the count is too high
apparently the detail is being clobbered and rewritten with a count
instead. I would have expected that it listed some of those objects,
say the first 40.

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)

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message O.B. 2007-04-04 22:36:19 How to suppress NOTICE messages
Previous Message Ed L. 2007-04-04 22:15:04 dropping role w/dependent objects

Browse pgsql-patches by date

  From Date Subject
Next Message Ed L. 2007-04-04 22:39:07 Re: dropping role w/dependent objects
Previous Message Ed L. 2007-04-04 22:15:04 dropping role w/dependent objects