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 1prjty-0006r3-2U for pgsql-admin@arkaria.postgresql.org; Wed, 26 Apr 2023 18:30:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1prjtx-0006nK-1i for pgsql-admin@arkaria.postgresql.org; Wed, 26 Apr 2023 18:30:01 +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 1prjtw-0006nB-NG for pgsql-admin@lists.postgresql.org; Wed, 26 Apr 2023 18:30:00 +0000 Received: from mout-u-107.mailbox.org ([2001:67c:2050:101:465::107]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1prjtu-0022ac-Bv for pgsql-admin@lists.postgresql.org; Wed, 26 Apr 2023 18:29:59 +0000 Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (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-107.mailbox.org (Postfix) with ESMTPS id 4Q66q40WVQz9sR0; Wed, 26 Apr 2023 20:29:52 +0200 (CEST) Date: Wed, 26 Apr 2023 20:29:51 +0200 (CEST) From: Erik Wienhold To: Holger Jakobs , pgsql-admin@lists.postgresql.org, richard coleman Message-ID: <874394544.1204470.1682533791565@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:55 CEST Holger Jakobs wrote: > > Am 26.04.23 um 19:53 schrieb richard coleman: > > > ERROR: role "role" does not exist > > LINE 3: WHERE grantee = 'role'::regrole AND privilege_type I... > > ^ > > SQL state: 42704 > > Character: 151 > > If you want to use the SQL statements used by psql on older versions of > PostgreSQL, you should use the old version of psql. 'role'::regrole works perfectly fine since pg9.5 if the role exists. Use grantee::regrole::text = 'role' to be safe. -- Erik