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 1prjmF-0006WI-4B for pgsql-admin@arkaria.postgresql.org; Wed, 26 Apr 2023 18:22:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1prjmD-0001bU-Gg for pgsql-admin@arkaria.postgresql.org; Wed, 26 Apr 2023 18:22:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1prjmD-0001bK-5Z for pgsql-admin@lists.postgresql.org; Wed, 26 Apr 2023 18:22:01 +0000 Received: from mout-u-204.mailbox.org ([2001:67c:2050:101:465::204]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1prjm8-005Def-0s for pgsql-admin@lists.postgresql.org; Wed, 26 Apr 2023 18:22:00 +0000 Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4Q66dm66LWz9sTf; Wed, 26 Apr 2023 20:21:48 +0200 (CEST) Date: Wed, 26 Apr 2023 20:21:48 +0200 (CEST) From: Erik Wienhold To: richard coleman Cc: pgsql-admin@lists.postgresql.org Message-ID: <812687998.1203746.1682533308355@office.mailbox.org> In-Reply-To: References: <2058602074.1048315.1682529431551@office.mailbox.org> Subject: Re: how to list privileges on the database object itself via SQL? MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 26/04/2023 19:53 CEST richard coleman wrote: > > Erik, > > Thanks for that. I'll have to look into the aclexplode() function some more. > > When I try running your SQL on a pg11 database I get: > > ERROR: role "role" does not exist > LINE 3: WHERE grantee = 'role'::regrole AND privilege_type I... > ^ > SQL state: 42704 > Character: 151 I used 'role'::regrole as example because your has_table_privilege sample uses that role name. Weird name for a role but I went along with it ;) -- Erik