public inbox for [email protected]  
help / color / mirror / Atom feed
dropuser error
4+ messages / 4 participants
[nested] [flat]

* dropuser error
@ 2025-09-16 20:13 Sam Stearns <[email protected]>
  2025-09-16 20:26 ` Re: dropuser error sami l <[email protected]>
  2025-09-16 21:27 ` Re: dropuser error Tom Lane <[email protected]>
  0 siblings, 2 replies; 4+ messages in thread

From: Sam Stearns @ 2025-09-16 20:13 UTC (permalink / raw)
  To: Pgsql-admin <[email protected]>; +Cc: Henry Ashu <[email protected]>; Julie Mather <[email protected]>

Howdy,

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

I have run queries to check for ownership on tables, views, sequences,
materialized views, functions, and schemas.  All return 0 (zero) rows.

Could anyone provide any advice here, please?

Thank you,

Sam

-- 

Samuel Stearns
Team Lead - Database
c: 971 762 6879 | o: 971 762 6879 | DAT.com

<https://www.dat.com/?utm_medium=email&utm_source=DAT_email_signature_link;


^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: dropuser error
  2025-09-16 20:13 dropuser error Sam Stearns <[email protected]>
@ 2025-09-16 20:26 ` sami l <[email protected]>
  1 sibling, 0 replies; 4+ messages in thread

From: sami l @ 2025-09-16 20:26 UTC (permalink / raw)
  To: Sam Stearns <[email protected]>; +Cc: Pgsql-admin <[email protected]>; Henry Ashu <[email protected]>; Julie Mather <[email protected]>

Hi,
Did you check the priviliges?

*Sami LEKESİZ*


16 Eyl 2025 Sal, saat 23:14 tarihinde Sam Stearns <[email protected]>
şunu yazdı:

> Howdy,
>
> 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
>
> I have run queries to check for ownership on tables, views, sequences,
> materialized views, functions, and schemas.  All return 0 (zero) rows.
>
> Could anyone provide any advice here, please?
>
> Thank you,
>
> Sam
>
> --
>
> Samuel Stearns
> Team Lead - Database
> c: 971 762 6879 | o: 971 762 6879 | DAT.com
>
> <https://www.dat.com/?utm_medium=email&utm_source=DAT_email_signature_link;
>
>


^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: dropuser error
  2025-09-16 20:13 dropuser error Sam Stearns <[email protected]>
@ 2025-09-16 21:27 ` Tom Lane <[email protected]>
  2025-09-16 21:30   ` Re: dropuser error Naveen Kumar <[email protected]>
  1 sibling, 1 reply; 4+ messages in thread

From: Tom Lane @ 2025-09-16 21:27 UTC (permalink / raw)
  To: Sam Stearns <[email protected]>; +Cc: Pgsql-admin <[email protected]>; Henry Ashu <[email protected]>; Julie Mather <[email protected]>

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





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: dropuser error
  2025-09-16 20:13 dropuser error Sam Stearns <[email protected]>
  2025-09-16 21:27 ` Re: dropuser error Tom Lane <[email protected]>
@ 2025-09-16 21:30   ` Naveen Kumar <[email protected]>
  0 siblings, 0 replies; 4+ messages in thread

From: Naveen Kumar @ 2025-09-16 21:30 UTC (permalink / raw)
  To: Tom Lane <[email protected]>; +Cc: Sam Stearns <[email protected]>; Pgsql-admin <[email protected]>; Henry Ashu <[email protected]>; Julie Mather <[email protected]>

Check in *csbtest *DB for dependent objects. And there might be default
privileges set for that role.

Thanks & Regards,
Naveen Kumar .M,
Lead DBA
Mobile: 7755929449.



On Wed, Sep 17, 2025 at 2:57 AM Tom Lane <[email protected]> wrote:

> 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
>
>
>


^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2025-09-16 21:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-09-16 20:13 dropuser error Sam Stearns <[email protected]>
2025-09-16 20:26 ` sami l <[email protected]>
2025-09-16 21:27 ` Tom Lane <[email protected]>
2025-09-16 21:30   ` Naveen Kumar <[email protected]>

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