Re: FmgrInfo allocation patterns (and PL handling as staged programming)

Chapman Flack <jcflack@acm.org>

From: Chapman Flack <jcflack@acm.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>, Peter Eisentraut <peter@eisentraut.org>
Date: 2025-04-07T00:41:04Z
Lists: pgsql-hackers
On 04/06/25 20:01, Tom Lane wrote:
> Looking more closely at ProcedureCreate(), it makes a dependency
> if a transform *exists* for the argument or result type, whether
> a TRANSFORM clause is present or not.  Surely this is completely
> bogus?  We should be depending on the OIDs mentioned in protrftypes,

I think that's it. I tested by creating a function like

create function foo() returns text transform for type circle

that is, with the transform type not appearing as an argument or
return type.

As far as I know, that's still a cromulent usage, as I could be saying
I want the function to apply that transform to circles it uses or retrieves
in queries it makes.

But if the dependency is being created based on argument/return types
and not on protrftypes, that will slip right through the cracks.

Regards,
-Chap



Commits

  1. Fix erroneous construction of functions' dependencies on transforms.

  2. Change SQL-language functions to use the plan cache.