Search Postgresql Archives

Re: How to remove user specific grant and revoke

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On 03/06/2023 14:46 CEST Erik Wienhold <ewie@xxxxxxxxx> wrote:
>
> > On 03/06/2023 09:16 CEST Andrus <kobruleht2@xxxxxx> 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





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux