Re: Completely replacing an old user - Mailing list pgsql-admin

From Erik Wienhold
Subject Re: Completely replacing an old user
Date
Msg-id 495059484.82333.1694896650450@office.mailbox.org
Whole thread Raw
In response to Completely replacing an old user  (Koen De Groote <kdg.dev@gmail.com>)
List pgsql-admin
On 16/09/2023 20:27 CEST Koen De Groote <kdg.dev@gmail.com> wrote:

> I am trying to set up a new user for a client application, and thus want to
> remove the old user afterward.
>
> But I'm getting stuck on one last error message:
>
> ERROR:  role "X" cannot be dropped because some objects depend on it
> DETAIL:  privileges for default privileges on new functions belonging to
> role postgres in schema public

You must also revoke its default privileges before you can drop a role.
That's mentioned in the notes of ALTER DEFAULT PRIVILEGES [1].

> The "new functions" bit is confusing. I've swapped over all the current
> functions, but cannot seem to find the appropriate table for privileges on
> new functions.

psql command \ddp will show you the default privileges.

[1] https://www.postgresql.org/docs/16/sql-alterdefaultprivileges.html#SQL-ALTERDEFAULTPRIVILEGES-NOTES

--
Erik



pgsql-admin by date:

Previous
From: Koen De Groote
Date:
Subject: Completely replacing an old user
Next
From: "David G. Johnston"
Date:
Subject: Re: Completely replacing an old user