From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Andrus <kobruleht2@hot.ee>
To: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Which commands are guaranteed to drop role
Date: Sun, 12 Apr 2020 22:09:29 +0200
Message-ID: <c2bf16aa98b94a87208577ada15ab222aff6c3d3.camel@cybertec.at> (raw)
In-Reply-To: <E71C41A2E324446CB790F4421E3CABB1@dell2>
References: <E71C41A2E324446CB790F4421E3CABB1@dell2>
On Sun, 2020-04-12 at 00:25 +0300, Andrus wrote:
> User "currentuser" tries to delete role "roletodelete" from this database using
>
> But got error
>
> ERROR: role "roletodelete" cannot be dropped because some objects depend on it
> DETAIL: privileges for schema public;
>
> How to create script which is guaranteed to delete role ?
You cannot write such a script, but you will have to REVOKE and change ownership
and ALTER DEFAULT PRIVILEGES until no more dependencies on the role exist.
That is why you are well advised not to grant permissions to a role that you
plan to drop.
Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com
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: laurenz.albe@cybertec.at, kobruleht2@hot.ee
Subject: Re: Which commands are guaranteed to drop role
In-Reply-To: <c2bf16aa98b94a87208577ada15ab222aff6c3d3.camel@cybertec.at>
References: <E71C41A2E324446CB790F4421E3CABB1@dell2> <c2bf16aa98b94a87208577ada15ab222aff6c3d3.camel@cybertec.at>
* 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