Re: Cast to regrole on a literal string in a PL/pgSQL function - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Cast to regrole on a literal string in a PL/pgSQL function
Date
Msg-id 491035.1759246191@sss.pgh.pa.us
Whole thread Raw
In response to Re: Cast to regrole on a literal string in a PL/pgSQL function  (LEMAIRE Leslie (Chargée de mission) - SG/DNUM/UNI/DRC <leslie.lemaire@developpement-durable.gouv.fr>)
List pgsql-bugs
=?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



pgsql-bugs by date:

Previous
From: Erki Eessaar
Date:
Subject: Re: Potential bug: Enforcing/not enforcing a CHECK constraint fails on an empty table