]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Improve plpgsql's ability to handle arguments declared as RECORD.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 16 Sep 2022 17:23:01 +0000 (13:23 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 16 Sep 2022 17:23:01 +0000 (13:23 -0400)
commit7391ab28a63f4b40cec03dc83eb7383a4eac8fda
treeadc3903777977abde28defaa631a848206ea8b50
parent19bb5e46b95fa8543a9e685788ff6c514eda07fc
Improve plpgsql's ability to handle arguments declared as RECORD.

Treat arguments declared as RECORD as if that were a polymorphic type
(which it is, sort of), in that we substitute the actual argument type
while forming the function cache lookup key.  This allows the specific
composite type to be known in some cases where it was not before,
at the cost of making a separate function cache entry for each named
composite type that's passed to the function during a session.  The
particular symptom discussed in bug #17610 could be solved in other
more-efficient ways, but only at the cost of considerable development
work, and there are other cases where we'd still fail without this.

Per bug #17610 from Martin JurĨa.  Back-patch to v11 where we first
allowed plpgsql functions to be declared as taking type RECORD.

Discussion: https://postgr.es/m/17610-fb1eef75bf6c2364@postgresql.org
src/pl/plpgsql/src/expected/plpgsql_record.out
src/pl/plpgsql/src/pl_comp.c
src/pl/plpgsql/src/sql/plpgsql_record.sql