Re: cannot drop user - Mailing list pgsql-general

From Tom Lane
Subject Re: cannot drop user
Date
Msg-id 27718.1414518123@sss.pgh.pa.us
Whole thread Raw
In response to cannot drop user  ("Michael P. Soulier" <msoulier@digitaltorque.ca>)
Responses Re: cannot drop user
List pgsql-general
"Michael P. Soulier" <msoulier@digitaltorque.ca> writes:
> I've dropped a db and now I'm trying to drop the user that owns all of it, but
> I can't.

> dropdb: database removal failed: ERROR:  database "tugdb" does not exist
> [2014-10-28 13:23:40,462] INFO:Dropping user...
> dropuser: removal of role "tugdbuser" failed: ERROR:  role "tugdbuser" cannot
> be dropped because some objects depend on it
> DETAIL:  owner of table taps
> owner of table siptrunks
> ... etc

> The tugdb database is gone but these artifacts are all from it. How is that
> possible if the db is gone?

Those DETAIL lines are complaining about objects that are in the database
you're currently attached to; the details about object names and so on
would not be available otherwise.  So I suspect at some point you
accidentally loaded a pg_dump script or suchlike into some other database
besides the tugdb one ...

DROP OWNED BY might be the easiest way to clean up the mess.

            regards, tom lane


pgsql-general by date:

Previous
From: Jerry Sievers
Date:
Subject: Re: cannot drop user
Next
From: "Michael P. Soulier"
Date:
Subject: Re: cannot drop user