AW: Which commands are guaranteed to drop role

From: "Zwettler Markus (OIZ)" <Markus(dot)Zwettler(at)zuerich(dot)ch>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Cc: Andrus <kobruleht2(at)hot(dot)ee>
Subject: AW: Which commands are guaranteed to drop role
Date: 2020-04-14 09:01:16
Message-ID: 870a9d9724a243acb50d162304333865@zuerich.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> -----Ursprüngliche Nachricht-----
> Von: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
> Gesendet: Sonntag, 12. April 2020 22:09
> An: Andrus <kobruleht2(at)hot(dot)ee>; pgsql-general <pgsql-general(at)postgresql(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ц 2020-04-14 12:47:59 Invalid name syntax on to_regrole(session_user)
Previous Message Olivier Gautherot 2020-04-13 20:15:03 Re: Using Oracle SQL Client commands with PSQL 12.2 DB