Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v3Hlz-00Dzfe-TV for pgsql-bugs@arkaria.postgresql.org; Mon, 29 Sep 2025 17:34:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1v3Hlx-0036fp-OU for pgsql-bugs@arkaria.postgresql.org; Mon, 29 Sep 2025 17:34:50 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v3Hlx-0036fg-Fq for pgsql-bugs@lists.postgresql.org; Mon, 29 Sep 2025 17:34:50 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1v3Hlv-000YKh-2G for pgsql-bugs@lists.postgresql.org; Mon, 29 Sep 2025 17:34:49 +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 58THYXtU218023; Mon, 29 Sep 2025 13:34:35 -0400 From: Tom Lane To: =?UTF-8?Q?LEMAIRE_Leslie_=28Charg=C3=A9e_de_mission=29_=2D_SG=2FDNUM=2F?= =?UTF-8?Q?UNI=2FDRC?= cc: pgsql-bugs@lists.postgresql.org Subject: Re: Cast to regrole on a literal string in a PL/pgSQL function In-reply-to: References: Comments: In-reply-to =?UTF-8?Q?LEMAIRE_Leslie_=28Charg=C3=A9e_de_mission=29_=2D_SG=2FDNUM=2F?= =?UTF-8?Q?UNI=2FDRC?= message dated "Mon, 29 Sep 2025 14:36:15 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <218021.1759167273.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 29 Sep 2025 13:34:33 -0400 Message-ID: <218022.1759167273@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk =3D?UTF-8?Q?LEMAIRE_Leslie_=3D28Charg=3DC3=3DA9e_de_mission=3D29_=3D2D_SG=3D= 2FDNUM=3D2F?=3D =3D?UTF-8?Q?UNI=3D2FDRC?=3D writes: > I've noticed a rather odd behavior with a PL/pgSQL function whose = > definition includes a cast to regrole on a literal string, such as = > 'a_role'::regrole. Yeah, the coverage for REG* constants in plan invalidation is pretty thin --- in fact, I think this *only* works correctly for regclass constants. AFAIR you're the first to complain, so I'm not sure that we want to expend the effort to expand that ... regards, tom lane