Ron <ronljohnsonjr@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
------------
template1
template0
regression
(3 rows)
regards, tom lane