pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Improve plpgsql's ability to handle arguments declared as RECORD
Date: Fri, 16 Sep 2022 17:23:20 +0000
Message-ID: <E1oZF3g-000dNm-0G@gemulon.postgresql.org> (raw)

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

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/56d45fdab7b12cd0c767a8c1e7ab6c04390a32d8

Modified Files
--------------
src/pl/plpgsql/src/expected/plpgsql_record.out | 35 ++++++++++++++++++++++++++
src/pl/plpgsql/src/pl_comp.c                   | 34 ++++++++++++++++++++++---
src/pl/plpgsql/src/sql/plpgsql_record.sql      | 11 ++++++++
3 files changed, 76 insertions(+), 4 deletions(-)



view thread (6+ messages)

Message-ID: <E1oZF3g-000dNm-0G@gemulon.postgresql.org>
Permalink:  ../E1oZF3g-000dNm-0G@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1oZF3g-000dNm-0G@gemulon.postgresql.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Improve plpgsql's ability to handle arguments declared as RECORD
  In-Reply-To: <E1oZF3g-000dNm-0G@gemulon.postgresql.org>
  References: <E1oZF3g-000dNm-0G@gemulon.postgresql.org>

* 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