From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dominique Devienne <ddevienne@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: About revoking large number of privileges; And the PUBLIC role.
Date: Thu, 07 Jul 2022 09:52:26 -0400
Message-ID: <2915672.1657201946@sss.pgh.pa.us> (raw)
In-Reply-To: <CAFCRh-9Z6V2wt4EsCZMo+wvXBf=sSN9de2Tst-fE99WYTE4Q9Q@mail.gmail.com>
References: <CAFCRh-9Z6V2wt4EsCZMo+wvXBf=sSN9de2Tst-fE99WYTE4Q9Q@mail.gmail.com>
Dominique Devienne <ddevienne@gmail.com> writes:
> Hi. I'm struggling to delete databases because of grants to roles on
> objects of those DBs.
> These DBs can have a large'ish number of schemas, 100-300 is typical.
> and define a bunch of ROLEs "specific" to those schemas. Normally "login user"
> ROLEs are never granted explicit access to objects, instead only the
> "db specific" ROLEs
> get those grants, and regular users are granted some of those ROLEs.
> So my goal is to delete all those "db specific" ROLEs, then the DB
> with all its schemas.
> Which implies REVOKE'ing grants on all those "db specific" ROLEs first.
You should not really have to revoke those manually.
The normal process for that is to use DROP OWNED BY.
https://www.postgresql.org/docs/current/role-removal.html
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, ddevienne@gmail.com
Subject: Re: About revoking large number of privileges; And the PUBLIC role.
In-Reply-To: <2915672.1657201946@sss.pgh.pa.us>
References: <CAFCRh-9Z6V2wt4EsCZMo+wvXBf=sSN9de2Tst-fE99WYTE4Q9Q@mail.gmail.com> <2915672.1657201946@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