pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ron <ronljohnsonjr@gmail.com>
Cc: pgsql-general@lists.postgresql.org, Bryn Llewellyn <bryn@yugabyte.com>
Subject: Re: Test if a database has any privilege granted to public
Date: Thu, 15 Dec 2022 01:10:55 -0500
Message-ID: <3300816.1671084655@sss.pgh.pa.us> (raw)
In-Reply-To: <d6410959-50a7-b0bd-ce0f-99dca388b815@gmail.com>
References: <0BFC452B-0AC8-46B3-9E65-B685544ED110@yugabyte.com>
	<d6410959-50a7-b0bd-ce0f-99dca388b815@gmail.com>

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





view thread (7+ messages)  latest in thread

Message-ID: <3300816.1671084655@sss.pgh.pa.us>
Permalink:  ../3300816.1671084655@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3300816.1671084655@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ronljohnsonjr@gmail.com, bryn@yugabyte.com
  Subject: Re: Test if a database has any privilege granted to public
  In-Reply-To: <3300816.1671084655@sss.pgh.pa.us>
  References: <0BFC452B-0AC8-46B3-9E65-B685544ED110@yugabyte.com> <d6410959-50a7-b0bd-ce0f-99dca388b815@gmail.com> <3300816.1671084655@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox