postgresql/src/include/executor
Dean Rasheed 344662848a Fix replica identity check for INSERT ON CONFLICT DO UPDATE.
If an INSERT has an ON CONFLICT DO UPDATE clause, the executor must
check that the target relation supports UPDATE as well as INSERT. In
particular, it must check that the target relation has a REPLICA
IDENTITY if it publishes updates. Formerly, it was not doing this
check, which could lead to silently breaking replication.

Fix by adding such a check to CheckValidResultRel(), which requires
adding a new onConflictAction argument. In back-branches, preserve ABI
compatibility by introducing a wrapper function with the original
signature.

Author: Zhijie Hou <houzj.fnst@fujitsu.com>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: Dean Rasheed <dean.a.rasheed@gmail.com>
Tested-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/OS3PR01MB57180C87E43A679A730482DF94B62@OS3PR01MB5718.jpnprd01.prod.outlook.com
Backpatch-through: 13
2025-09-04 11:32:00 +01:00
..
execAsync.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
execdebug.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
execdesc.h Revert "Don't lock partitions pruned by initial pruning" 2025-05-22 17:02:35 +09:00
execExpr.h Add special case fast-paths for strict functions 2025-03-11 12:02:42 +01:00
execParallel.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
execPartition.h Ensure first ModifyTable rel initialized if all are pruned 2025-03-19 12:14:24 +09:00
execScan.h Refactor ExecScan() to allow inlining of its core logic 2025-01-21 12:53:03 +09:00
executor.h Fix replica identity check for INSERT ON CONFLICT DO UPDATE. 2025-09-04 11:32:00 +01:00
functions.h Change SQL-language functions to use the plan cache. 2025-04-02 14:06:02 -04:00
hashjoin.h Get rid of our dependency on type "long" for memory size calculations. 2025-01-31 13:52:40 -05:00
instrument.h Move wal_buffers_full from PgStat_PendingWalStats to WalUsage 2025-02-17 13:14:28 +09:00
nodeAgg.h Sync typedefs.list with the buildfarm. 2025-06-15 13:04:24 -04:00
nodeAppend.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeBitmapAnd.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeBitmapHeapscan.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeBitmapIndexscan.h Show index search count in EXPLAIN ANALYZE, take 2. 2025-03-11 09:20:50 -04:00
nodeBitmapOr.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeCtescan.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeCustom.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeForeignscan.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeFunctionscan.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeGather.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeGatherMerge.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeGroup.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeHash.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeHashjoin.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeIncrementalSort.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeIndexonlyscan.h Show index search count in EXPLAIN ANALYZE, take 2. 2025-03-11 09:20:50 -04:00
nodeIndexscan.h Show index search count in EXPLAIN ANALYZE, take 2. 2025-03-11 09:20:50 -04:00
nodeLimit.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeLockRows.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeMaterial.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeMemoize.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeMergeAppend.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeMergejoin.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeModifyTable.h Virtual generated columns 2025-02-07 09:46:59 +01:00
nodeNamedtuplestorescan.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeNestloop.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeProjectSet.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeRecursiveunion.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeResult.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeSamplescan.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeSeqscan.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeSetOp.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeSort.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeSubplan.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeSubqueryscan.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeTableFuncscan.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeTidrangescan.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeTidscan.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeUnique.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeValuesscan.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeWindowAgg.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodeWorktablescan.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
spi.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
spi_priv.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
tablefunc.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
tqueue.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
tstoreReceiver.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
tuptable.h Add ExecCopySlotMinimalTupleExtra(). 2025-03-24 22:05:53 -07:00