public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Sam Stearns <[email protected]>
Cc: Pgsql-admin <[email protected]>
Cc: Henry Ashu <[email protected]>
Cc: Julie Mather <[email protected]>
Subject: Re: dropuser error
Date: Tue, 16 Sep 2025 17:27:05 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAN6TVj=sfdK=W08kVtVOcn_QLYtFby-jVxuw+F+UYM42fkt91A@mail.gmail.com>
References: <CAN6TVj=sfdK=W08kVtVOcn_QLYtFby-jVxuw+F+UYM42fkt91A@mail.gmail.com>

Sam Stearns <[email protected]> writes:
> I'm trying to drop a user but getting the following error:

> dropuser: error: removal of role "dalec" failed: ERROR:  role "dalec"
> cannot be dropped because some objects depend on it
> DETAIL:  262 objects in database csbtest

If the display looks like that rather than itemizing the objects,
it's because they are in a different database of the cluster.
You need to connect to the "csbtest" database and then you can
drop or reassign ownership of those objects.

(The subtext here is that users/roles are shared across the
whole cluster, but most object kinds are local to one database.
You can't "see" the details of objects in a different database
than the one you're connected to.  DROP USER knows that there
are some dependencies, but not much more.)

			regards, tom lane





reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: dropuser error
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox