Re: Test if a database has any privilege granted to public

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ron <ronljohnsonjr(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org, Bryn Llewellyn <bryn(at)yugabyte(dot)com>
Subject: Re: Test if a database has any privilege granted to public
Date: 2022-12-15 06:10:55
Message-ID: 3300816.1671084655@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ron <ronljohnsonjr(at)gmail(dot)com> writes:
> Off-topic, but you don't need all those text casts.

Indeed. Something like this ought to do it:

=# select datname from pg_database where 0::oid = any(select (aclexplode(datacl)).grantee);
datname
------------
template1
template0
regression
(3 rows)

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Willy-Bas Loos 2022-12-15 07:31:30 Re: tcp keepalives not sent during long query
Previous Message Ron 2022-12-15 06:03:08 Re: Test if a database has any privilege granted to public