On Thu, Dec 15, 2022 at 5:17 PM Bryn Llewellyn wrote:
>
> There's no mention on the "Privileges" page of the
> "has_database_privilege()" function. Nor of "aclexplode()".
> Even now, I haven't managed a linear start to finish read of the entire PG
> docs. And I found "has_database_privilege()"
> david.g.johns...@gmail.com wrote:
>
>> b...@yugabyte.com wrote:
>>
>> select datname::text
>> from pg_database
>> where 0::oid = any(select (aclexplode(datacl)).grantee)
>> or datacl is null;
>>
>> That's easy if you know that you need to write this. But the need to do so
>> seems to depend o
On Thu, Dec 15, 2022 at 12:51 PM Bryn Llewellyn wrote:
>
>
>
>
>
> *select datname::textfrom pg_databasewhere 0::oid = any(select
> (aclexplode(datacl)).grantee)or datacl is null;*
> That's easy if you know that you need to write this. But the need to do so
> seems to depend on pretty arcane know
> t...@sss.pgh.pa.us wrote:
>
>> ronljohnso...@gmail.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
>
Ron 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)
Off-topic, but you don't need all those text casts.
On 12/14/22 23:44, Bryn Llewellyn wrote:
I want to adopt a rule that no database in my cluster has any privilege
granted to public. It suits me best to encapsulate the test as a boolean
function thus:
*function mgr.db_has_priv_granted_to_pub
I want to adopt a rule that no database in my cluster has any privilege granted
to public. It suits me best to encapsulate the test as a boolean function thus:
function mgr.db_has_priv_granted_to_public(db in name)
where "mgr" is a convenient schema for various admin utilities. I have
implement