Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1prirA-0003og-GK for pgsql-admin@arkaria.postgresql.org; Wed, 26 Apr 2023 17:23:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1prir9-0004Fs-Ey for pgsql-admin@arkaria.postgresql.org; Wed, 26 Apr 2023 17:23:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1prir9-0004Fj-3c for pgsql-admin@lists.postgresql.org; Wed, 26 Apr 2023 17:23:03 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1prir6-0021wP-Qy for pgsql-admin@lists.postgresql.org; Wed, 26 Apr 2023 17:23:01 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 33QHMx48875042; Wed, 26 Apr 2023 13:22:59 -0400 From: Tom Lane To: richard coleman cc: pgsql-admin@lists.postgresql.org Subject: Re: how to list privileges on the database object itself via SQL? In-reply-to: References: <870558.1682527243@sss.pgh.pa.us> Comments: In-reply-to richard coleman message dated "Wed, 26 Apr 2023 13:20:14 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <875040.1682529779.1@sss.pgh.pa.us> Date: Wed, 26 Apr 2023 13:22:59 -0400 Message-ID: <875041.1682529779@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk richard coleman writes: > Thanks, but no. I am looking for the SQL statement. > I very rarely venture into psql, unless it's to run an SQL code block from > the terminal. > Is there an SQL way to do this? psql is still a useful reference. Run it with the -E option and look at the SQL it issues when you say "\l". Trim to fit your requirements. regards, tom lane