MERGE
SQL MERGE command combining INSERT, UPDATE and DELETE, later with RETURNING, views and WHEN NOT MATCHED BY SOURCE. Introduced in PostgreSQL 15.
Versions
- PostgreSQL 18 · worked-on · improved · minor
- PostgreSQL 17 · shipped · improved · moderate · 4 commits · +3.8k / -869 lines
- PostgreSQL 16 · worked-on · improved · moderate
Threads
- BUG #19942: SIGSEGV crash (and wrong results) in MERGE ... RETURNING WITH (OLD/NEW) with VIRTUAL generated colum
- Columns assigned by MERGE can be dropped from SQL-standard function bodies
- Fix stale source values in MERGE RETURNING after a cross-partition update
- MERGE fails to reject source references in NOT MATCHED BY SOURCE actions
- BUG #19912: MERGE NOT MATCHED BY SOURCE sees stale source values after concurrent update (EPQ)
- Wrong varnullingrels for MERGE into a trigger-updatable view
- BUG #19689: MERGE INSERT accepts a set-returning function during PREPARE but fails at EXECUTE
- EXPLAIN ANALYZE overcounts MERGE inserts suppressed by triggers
- MERGE loses UPDATE transition rows when moving rows between partitions
- MERGE fails with RETURNING when an excluded inheritance parent has an extra-column child
- BUG #19802: MERGE into a partitioned table fails with "SubPlan found with no parent plan"
- EXPLAIN (ANALYZE, FORMAT JSON) emits invalid output for MERGE on a partitioned table
- Bug in statement trigger for MERGE operations that move rows between partitions
- merge-delete isolation test fails since 85f55534e80
- wrong results: merge when not matched by source
- BUG #19462: MERGE on partitioned table with INSERT DEFAULT VALUES fails with "unknown action in MERGE WHEN clau
- BUG #19463: Server crash (Assertion failure) when using MERGE statement in CTE
- BUG #19461: MERGE with EXISTS subquery referencing USING clause alias fails with "variable not found in subplan
- MERGE behavior with REPEATABLE READ isolation level
- BUG #19421: PostgreSQL MERGE Crash: heap_compute_data_size() at heaptuple.c:236
- BUG #19380: Transition table in AFTER INSERT trigger misses rows from MERGE when used with INSERT in a CTE
- BUG #19111: Using EXPLAIN ANALYZE with MERGE causes failed assert
- MERGE command is not mentioned in the list of commands for variable substitution
- Fix outdated comment of CopyStmt in gram.y
- Inconsistent update in the MERGE command
- Fix replica identity checks for MERGE command on published table.
- BUG #18986: SIGSEGV in nodeModifyTable.c during Parallel Execution
- MERGE docs: indentation in synopsis section
- MERGE issues around inheritance
- BUG #18871: Cross-partition MERGE fails with unclear internal error
- Attribute of type record has wrong type error with MERGE ... WHEN NOT MATCHED BY SOURCE THEN DELETE
- tab_complete for copy(merge
- MERGE examples not clear
- BUG #18634: Wrong varnullingrels with merge ... when not matched by source
- [PATCH] Replace magic constant 3 with NUM_MERGE_MATCH_KINDS
- minor comments issue in ResultRelInfo src/include/nodes/execnodes.h
- Minor fixes for couple some comments around MERGE RETURNING
- avoid MERGE_ACTION keyword?
- MERGE ... WHEN NOT MATCHED BY SOURCE
- Broken EXPLAIN output for SubPlan in MERGE
- MERGE ... RETURNING
- bug report: some issues about pg_15_stable(8fa4a1ac61189efffb8b851ee77e1bc87360c445)
- Supporting MERGE on updatable views
- Running the fdw test from the terminal crashes into the core-dump
- 回复: bug report: some issues about pg_15_stable(8fa4a1ac61189efffb8b851ee77e1bc87360c445)
- bug report: some issues about pg_15_stable(8fa4a1ac61189efffb8b851ee77e1bc87360c445)
- sql-merge.html Compatibility section, typo.
- BUG #18238: Cross-partitition MERGE/UPDATE with delete-preventing trigger leads to incorrect memory access
- MERGE: AFTER ROW trigger failure for cross-partition update
- BUG #18103: bugs of concurrent merge into when use different join plan
- BUG #18108: server process was terminated by signal 11: Segmentation fault
- BUG #18043: Merge fails to insert when source and target are same table and table is empty (contains no rows)
- Confusing reference to MERGE use inside WITH
- [PATCH]Feature improvement for MERGE tab completion
- [PATCH] doc: add missing mention of MERGE in MVCC
- [PATCH] two minor fixes to MVCC docs
- MERGE lacks ruleutils.c decompiling support!?
- "variable not found in subplan target list"
- Merge command is erroring with: PlaceHolderVar found where not expected
- Lock mode in ExecMergeMatched()
- BUG #17792: MERGE uses uninitialized pointer and crashes when target tuple is updated concurrently
- BUG #17809: MERGE ... UPDATE fails with BEFORE ROW UPDATE trigger when target row updated concurrently
- Doc updates for MERGE
- Missing cases from SPI_result_code_string()
- Assert failure with MERGE into partitioned table with RLS
- Incorrect command tag row count for MERGE with a cross-partition update
- Allow MERGE to be executed from PL/Tcl
- Bug #17759: GENERATED columns not computed during MERGE
- BUG #17759: MERGE UPDATE statements do not cause generated columns to update
- Bug in check for unreachable MERGE WHEN clauses
- Issue in MERGE with concurrent UPDATE and MERGE
- Documenting MERGE INTO ONLY ...
- Bug in MERGE's test for tables with rules
- MERGE regress test
- Merge statement
- Fix the README file for MERGE command
- Some comments that should've covered MERGE
- Fix error message for MERGE foreign tables
- BUG #17631: Prepare + Merge fails to identify parameter types
- Doc fix and adjustment for MERGE command
- Re: MERGE and parsing with prepared statements
- BUG #17579: 15beta2: strange error when trying to use MERGE statement as a CTE
- support for MERGE
- MERGE and parsing with prepared statements
- Add index item for MERGE.
- minor MERGE cleanups
- support for MERGE
- MERGE bug report
- merge documentation fix
- MERGE SQL statement for PG12
- MERGE SQL Statement for PG11
- pgsql: New files for MERGE
- Add support for printing/reading MergeAction nodes
- Missing parse_merge.h?
- SQL MERGE patches for PostgreSQL Versions