pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: LEMAIRE Leslie (Chargée de mission) - SG/DNUM/UNI/DRC <leslie.lemaire@developpement-durable.gouv.fr>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: Cast to regrole on a literal string in a PL/pgSQL function
Date: Tue, 30 Sep 2025 11:29:51 -0400
Message-ID: <491035.1759246191@sss.pgh.pa.us> (raw)
In-Reply-To: <2d723791540f2bdbd76da34d7e90f8ee@developpement-durable.gouv.fr>
References: <da2802eab456f4ec168b5053023bafd7@developpement-durable.gouv.fr>
	<218022.1759167273@sss.pgh.pa.us>
	<367243.1759184744@sss.pgh.pa.us>
	<2d723791540f2bdbd76da34d7e90f8ee@developpement-durable.gouv.fr>

=?UTF-8?Q?LEMAIRE_Leslie_=28Charg=C3=A9e_de_mission=29_=2D_SG=2FDNUM=2F?= =?UTF-8?Q?UNI=2FDRC?= <leslie.lemaire@developpement-durable.gouv.fr> 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





view thread (5+ messages)

Message-ID: <491035.1759246191@sss.pgh.pa.us>
Permalink:  ../491035.1759246191@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/491035.1759246191@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, leslie.lemaire@developpement-durable.gouv.fr, pgsql-bugs@lists.postgresql.org
  Subject: Re: Cast to regrole on a literal string in a PL/pgSQL function
  In-Reply-To: <491035.1759246191@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox