pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Erik Wienhold <ewie@ewie.name>
To: Koen De Groote <kdg.dev@gmail.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: Completely replacing an old user
Date: Sat, 16 Sep 2023 22:37:30 +0200 (CEST)
Message-ID: <495059484.82333.1694896650450@office.mailbox.org> (raw)
In-Reply-To: <CAGbX52H6XVMzZ96TcyArjOPw2KCUpQ6EC1Ch=yPAyUxsL1Qreg@mail.gmail.com>
References: <CAGbX52H6XVMzZ96TcyArjOPw2KCUpQ6EC1Ch=yPAyUxsL1Qreg@mail.gmail.com>

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





view thread (6+ messages)  latest in thread

Message-ID: <495059484.82333.1694896650450@office.mailbox.org>
Permalink:  ../495059484.82333.1694896650450@office.mailbox.org/
Also on:    postgresql.org/message-id/495059484.82333.1694896650450@office.mailbox.org

 · 

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: pgsql-admin@postgresql.org
  Cc: ewie@ewie.name, kdg.dev@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Completely replacing an old user
  In-Reply-To: <495059484.82333.1694896650450@office.mailbox.org>

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

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