pgsql: Move plpython's rejection of pseudotype arguments/results.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Move plpython's rejection of pseudotype arguments/results.
Date: 2026-11-01 22:28:32
Message-ID: E1xNe2S-00000001iGc-0voK@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Move plpython's rejection of pseudotype arguments/results.

Perform this work in the validator function, rather than repeating
it during every function call. The previous coding not only
performed unnecessary catalog lookups during function call setup,
but failed to detect invalid argument types at CREATE FUNCTION
time if check_function_bodies is off. That's not how that's
supposed to work.

Review of this patch exposed that we were not testing some cases
involving record-type output parameters, so add tests memorializing
the expected behavior.

In passing, fix an obsolete comment in plpython_composite.sql.

Author: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Reviewed-by: shihao zhong <zhong950419(at)gmail(dot)com>
Discussion: https://postgr.es/m/2865288.1793403201@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/00d33e82bbb087d0f77fb5f49475885db62d1e37

Modified Files
--------------
src/pl/plpython/expected/plpython_composite.out | 11 ++++-
src/pl/plpython/expected/plpython_record.out | 28 +++++++++++++
src/pl/plpython/plpy_main.c | 56 +++++++++++++++++++++++--
src/pl/plpython/plpy_procedure.c | 48 +++------------------
src/pl/plpython/sql/plpython_composite.sql | 11 ++++-
src/pl/plpython/sql/plpython_record.sql | 17 ++++++++
6 files changed, 123 insertions(+), 48 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2026-11-01 23:14:19 pgsql: Fix pgoutput crash on missing option values
Previous Message Andrew Dunstan 2026-11-01 21:44:26 pgsql: meson: Avoid PATH bloat from NLS .mo targets in tmp_install test