From: Erik Wienhold <ewie@ewie.name>
To: Andrus <kobruleht2@hot.ee>
To: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: How to remove user specific grant and revoke
Date: Sat, 3 Jun 2023 15:07:52 +0200 (CEST)
Message-ID: <1408288797.797459.1685797672449@office.mailbox.org> (raw)
In-Reply-To: <2140448238.796716.1685796376553@office.mailbox.org>
References: <568e6761-d224-7c72-59f3-267b39bde227@hot.ee>
<2140448238.796716.1685796376553@office.mailbox.org>
> On 03/06/2023 14:46 CEST Erik Wienhold <ewie@ewie.name> wrote:
>
> > On 03/06/2023 09:16 CEST Andrus <kobruleht2@hot.ee> wrote:
> >
> > DROP REVOKE ALL ON TABLE public.kaspriv FROM all EXCEPT public;
> > DROP GRANT SELECT ON TABLE public.kaspriv FROM all EXCEPT public;
> >
> > This will be one-time action. It can be done manually in pgadmin or using
> > some script running once.
>
> Automate this with aclexplode[0] to get the privileges for specific grantees.
> Loop over the result set in a DO block, generate the REVOKE commands, and
> EXECUTE them.
>
> SELECT acl.grantee::regrole, acl.privilege_type
> FROM pg_class, aclexplode(relacl) acl
> WHERE oid = 'public.kaspriv'::regclass;
Or just execute those REVOKE ALL commands (except for PUBLIC) that pgAdmin
already gives you.
--
Erik
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: ewie@ewie.name, kobruleht2@hot.ee
Subject: Re: How to remove user specific grant and revoke
In-Reply-To: <1408288797.797459.1685797672449@office.mailbox.org>
References: <568e6761-d224-7c72-59f3-267b39bde227@hot.ee> <2140448238.796716.1685796376553@office.mailbox.org> <1408288797.797459.1685797672449@office.mailbox.org>
* 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