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 1v3cIi-000w2l-Mn for pgsql-bugs@arkaria.postgresql.org; Tue, 30 Sep 2025 15:30:00 +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 1v3cIg-00ApKq-L0 for pgsql-bugs@arkaria.postgresql.org; Tue, 30 Sep 2025 15:29:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v3cIg-00ApKi-D1 for pgsql-bugs@lists.postgresql.org; Tue, 30 Sep 2025 15:29:59 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1v3cIe-000vKU-0M for pgsql-bugs@lists.postgresql.org; Tue, 30 Sep 2025 15:29:58 +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 58UFTpLG491036; Tue, 30 Sep 2025 11:29:51 -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: <2d723791540f2bdbd76da34d7e90f8ee@developpement-durable.gouv.fr> References: <218022.1759167273@sss.pgh.pa.us> <367243.1759184744@sss.pgh.pa.us> <2d723791540f2bdbd76da34d7e90f8ee@developpement-durable.gouv.fr> 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 "Tue, 30 Sep 2025 11:25:46 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <491034.1759246191.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 30 Sep 2025 11:29:51 -0400 Message-ID: <491035.1759246191@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'm surprised that regnamespace isn't handled properly either, by the = > way. One test can't prove much, but this one doesn't fail with a cast to= = > regnamespace, unlike all other reg* except regclass. regnamespace constants do work, accidentally, because plancache.c is set up to flush *all* cached plans after any change in pg_namespace. That's because the possible effects on search-path lookups are too hard to predict. Now that I look, regoper/regoperator constants would probably be okay too, because changes in pg_operator also cause a plancache flush. regards, tom lane