postgresql/src/include/executor
Tom Lane 40d1bdeb72 Fix confusion about the return rowtype of SQL-language procedures.
There is a very ancient hack in check_sql_fn_retval that allows a
single SELECT targetlist entry of composite type to be taken as
supplying all the output columns of a function returning composite.
(This is grotty and fundamentally ambiguous, but it's really hard
to do nested composite-returning functions without it.)

As far as I know, that doesn't cause any problems in ordinary
functions.  It's disastrous for procedures however.  All procedures
that have any output parameters are labeled with prorettype RECORD,
and the CALL code expects it will get back a record with one column
per output parameter, regardless of whether any of those parameters
is composite.  Doing something else leads to an assertion failure
or core dump.

This is simple enough to fix: we just need to not apply that rule
when considering procedures.  However, that requires adding another
argument to check_sql_fn_retval, which at least in principle might be
getting called by external callers.  Therefore, in the back branches
convert check_sql_fn_retval into an ABI-preserving wrapper around a
new function check_sql_fn_retval_ext.

Per report from Yahor Yuzefovich.  This has been broken since we
implemented procedures, so back-patch to all supported branches.

Discussion: https://postgr.es/m/CABz5gWHSjj2df6uG0NRiDhZ_Uz=Y8t0FJP-_SVSsRsnrQT76Gg@mail.gmail.com
2024-03-12 18:16:10 -04:00
..
execAsync.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
execdebug.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
execdesc.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
execExpr.h Add back SQLValueFunction for SQL keywords 2023-05-17 10:19:17 +09:00
execParallel.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
execPartition.h Revert "Move PartitionPruneInfo out of plan nodes into PlannedStmt" 2023-05-04 12:09:59 +02:00
executor.h Fix misbehavior of EvalPlanQual checks with multiple result relations. 2023-05-19 14:26:40 -04:00
functions.h Fix confusion about the return rowtype of SQL-language procedures. 2024-03-12 18:16:10 -04:00
hashjoin.h Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
instrument.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeAgg.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeAppend.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeBitmapAnd.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeBitmapHeapscan.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeBitmapIndexscan.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeBitmapOr.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeCtescan.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeCustom.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeForeignscan.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeFunctionscan.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeGather.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeGatherMerge.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeGroup.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeHash.h Parallel Hash Full Join. 2023-03-31 11:34:03 +13:00
nodeHashjoin.h Allocate hash join files in a separate memory context 2023-05-19 17:17:58 +02:00
nodeIncrementalSort.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeIndexonlyscan.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeIndexscan.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeLimit.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeLockRows.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeMaterial.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeMemoize.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeMergeAppend.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeMergejoin.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeModifyTable.h Make new GENERATED-expressions code more bulletproof. 2023-01-15 13:14:52 -05:00
nodeNamedtuplestorescan.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeNestloop.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeProjectSet.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeRecursiveunion.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeResult.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeSamplescan.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeSeqscan.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeSetOp.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeSort.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeSubplan.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeSubqueryscan.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeTableFuncscan.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeTidrangescan.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeTidscan.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeUnique.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeValuesscan.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeWindowAgg.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodeWorktablescan.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
spi.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
spi_priv.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
tablefunc.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
tqueue.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
tstoreReceiver.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
tuptable.h Remove obsolete comment 2023-06-05 15:33:08 +02:00