postgresql/src/include/executor
Amit Langote 7f56eaff2f SQL/JSON: Fix casting for integer EXISTS columns in JSON_TABLE
The current method of coercing the boolean result value of
JsonPathExists() to the target type specified for an EXISTS column,
which is to call the type's input function via json_populate_type(),
leads to an error when the target type is integer, because the
integer input function doesn't recognize boolean literal values as
valid.

Instead use the boolean-to-integer cast function for coercion in that
case so that using integer or domains thereof as type for EXISTS
columns works. Note that coercion for ON ERROR values TRUE and FALSE
already works like that because the parser creates a cast expression
including the cast function, but the coercion of the actual result
value is not handled by the parser.

Tests by Jian He.

Reported-by: Jian He <jian.universality@gmail.com>
Author: Jian He <jian.universality@gmail.com>
Author: Amit Langote <amitlangote09@gmail.com>
Discussion: https://postgr.es/m/CACJufxEo4sUjKCYtda0_qt9tazqqKPmF1cqhW9KBOUeJFqQd2g@mail.gmail.com
Backpatch-through: 17
2024-07-30 10:34:17 +09:00
..
execAsync.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
execdebug.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
execdesc.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
execExpr.h SQL/JSON: Fix casting for integer EXISTS columns in JSON_TABLE 2024-07-30 10:34:17 +09:00
execParallel.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
execPartition.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
executor.h Support MERGE into updatable views. 2024-02-29 15:56:59 +00:00
functions.h Fix confusion about the return rowtype of SQL-language procedures. 2024-03-12 18:16:25 -04:00
hashjoin.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
instrument.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeAgg.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeAppend.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeBitmapAnd.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeBitmapHeapscan.h Show Parallel Bitmap Heap Scan worker stats in EXPLAIN ANALYZE 2024-07-09 12:15:47 +12:00
nodeBitmapIndexscan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeBitmapOr.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeCtescan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeCustom.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeForeignscan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeFunctionscan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeGather.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeGatherMerge.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeGroup.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeHash.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeHashjoin.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeIncrementalSort.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeIndexonlyscan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeIndexscan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeLimit.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeLockRows.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeMaterial.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeMemoize.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeMergeAppend.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeMergejoin.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeModifyTable.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeNamedtuplestorescan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeNestloop.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeProjectSet.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeRecursiveunion.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeResult.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeSamplescan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeSeqscan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeSetOp.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeSort.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeSubplan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeSubqueryscan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeTableFuncscan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeTidrangescan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeTidscan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeUnique.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeValuesscan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeWindowAgg.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeWorktablescan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
spi.h Add RETURNING support to MERGE. 2024-03-17 13:58:59 +00:00
spi_priv.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
tablefunc.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
tqueue.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
tstoreReceiver.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
tuptable.h Add TupleTableSlotOps.is_current_xact_tuple() method 2024-03-21 23:00:43 +02:00