Re: Cast to regrole on a literal string in a PL/pgSQL function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: LEMAIRE Leslie (Chargée de mission) - SG/DNUM/UNI/DRC <leslie(dot)lemaire(at)developpement-durable(dot)gouv(dot)fr>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: Cast to regrole on a literal string in a PL/pgSQL function
Date: 2025-09-29 17:34:33
Message-ID: 218022.1759167273@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2025-09-29 22:25:44 Re: Cast to regrole on a literal string in a PL/pgSQL function
Previous Message Tom Lane 2025-09-29 15:55:31 Re: BUG #19067: On master at commit 66cdef4425f3, "psql -c 'select 1' dbname" causes the backend to seg fault