Re: How to remove user specific grant and revoke - Mailing list pgsql-general

From Erik Wienhold
Subject Re: How to remove user specific grant and revoke
Date
Msg-id 1408288797.797459.1685797672449@office.mailbox.org
Whole thread Raw
In response to Re: How to remove user specific grant and revoke  (Erik Wienhold <ewie@ewie.name>)
Responses Re: How to remove user specific grant and revoke
List pgsql-general
> 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



pgsql-general by date:

Previous
From: Erik Wienhold
Date:
Subject: Re: How to remove user specific grant and revoke
Next
From: Ron
Date:
Subject: Re: pg_upgrade and schema complexity...