From: Tom Lane <tgl@sss.pgh.pa.us>
To: AC Gomez <antklc@gmail.com>
Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re:
Date: Mon, 22 Nov 2021 17:35:13 -0500
Message-ID: <4103977.1637620513@sss.pgh.pa.us> (raw)
In-Reply-To: <CABtmK-hdmKiuXZ+hYFBF_YC=KfZZB2tAp8ammt1tDnfXRrD-5g@mail.gmail.com>
References: <CABtmK-hdmKiuXZ+hYFBF_YC=KfZZB2tAp8ammt1tDnfXRrD-5g@mail.gmail.com>
AC Gomez <antklc@gmail.com> writes:
> REASSIGN OWNED BY old_role TO masteruser;
> DROP OWNED BY old_role;
> DROP USER old_role;
> The consensus online is that these are the steps to be taken to
> successfully remove roles, yet we get this error below:
> ERROR: role "old_role" cannot be dropped because some objects depend on it
> DETAIL: privileges for database the_database 96 objects in database
> the_database SQL state: 2BP01
> What is it that we could be missing here?
You need to do the REASSIGN OWNED and DROP OWNED steps in each
database of the cluster that old_role has any objects/privileges in.
You might need a manual revoke on "the_database" too; I'm not sure
if DROP OWNED does anything about DB-level privileges.
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, antklc@gmail.com
Subject: Re:
In-Reply-To: <4103977.1637620513@sss.pgh.pa.us>
References: <CABtmK-hdmKiuXZ+hYFBF_YC=KfZZB2tAp8ammt1tDnfXRrD-5g@mail.gmail.com> <4103977.1637620513@sss.pgh.pa.us>
* 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