From: Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>
To: Laurenz Albe <laurenz.albe@cybertec.at>
To: pgsql-general <pgsql-general@postgresql.org>
Cc: Andrus <kobruleht2@hot.ee>
Subject: AW: Which commands are guaranteed to drop role
Date: Tue, 14 Apr 2020 09:01:16 +0000
Message-ID: <870a9d9724a243acb50d162304333865@zuerich.ch> (raw)
In-Reply-To: <c2bf16aa98b94a87208577ada15ab222aff6c3d3.camel@cybertec.at>
References: <E71C41A2E324446CB790F4421E3CABB1@dell2>
<c2bf16aa98b94a87208577ada15ab222aff6c3d3.camel@cybertec.at>
> -----Ursprüngliche Nachricht-----
> Von: Laurenz Albe <laurenz.albe@cybertec.at>
> Gesendet: Sonntag, 12. April 2020 22:09
> An: Andrus <kobruleht2@hot.ee>; pgsql-general <pgsql-general@postgresql.org>
> Betreff: Re: Which commands are guaranteed to drop role
>
> 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
>
>
Is there a query to get all missing privileges not revoked yet?
Markus
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: Markus.Zwettler@zuerich.ch, laurenz.albe@cybertec.at, kobruleht2@hot.ee
Subject: Re: Which commands are guaranteed to drop role
In-Reply-To: <870a9d9724a243acb50d162304333865@zuerich.ch>
References: <E71C41A2E324446CB790F4421E3CABB1@dell2> <c2bf16aa98b94a87208577ada15ab222aff6c3d3.camel@cybertec.at> <870a9d9724a243acb50d162304333865@zuerich.ch>
* 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