- Notifications
You must be signed in to change notification settings - Fork4.9k
Commita4f7d33
committed
Fix AFTER ROW trigger execution in MERGE cross-partition update.
When executing a MERGE UPDATE action, if the UPDATE is turned into across-partition DELETE then INSERT, do not attempt to invoke AFTERUPDATE ROW triggers, or any of the other post-update actions inExecUpdateEpilogue().For consistency with a plain UPDATE command, such triggers should notbe fired (and typically fail anyway), and similarly, other post-updateactions, such as WCO/RLS checks should not be executed, and might alsolead to unexpected failures.Therefore, as with ExecUpdate(), make ExecMergeMatched() returnimmediately if ExecUpdateAct() reports that a cross-partition updatewas done, to be sure that no further processing is done for thattuple.Back-patch to v15, where MERGE was introduced.Discussion:https://postgr.es/m/CAEZATCWjBgagyNZs02vgDF0DvASYj-iHTFtXG2-nP3orZhmtcw%40mail.gmail.com1 parent10d34fe commita4f7d33
File tree
3 files changed
+97
-0
lines changed- src
- backend/executor
- test/regress
- expected
- sql
3 files changed
+97
-0
lines changedLines changed: 16 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2899 | 2899 |
| |
2900 | 2900 |
| |
2901 | 2901 |
| |
| 2902 | + | |
| 2903 | + | |
| 2904 | + | |
| 2905 | + | |
| 2906 | + | |
| 2907 | + | |
| 2908 | + | |
| 2909 | + | |
| 2910 | + | |
| 2911 | + | |
| 2912 | + | |
| 2913 | + | |
| 2914 | + | |
| 2915 | + | |
| 2916 | + | |
| 2917 | + | |
2902 | 2918 |
| |
2903 | 2919 |
| |
2904 | 2920 |
| |
|
Lines changed: 45 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2309 | 2309 |
| |
2310 | 2310 |
| |
2311 | 2311 |
| |
| 2312 | + | |
| 2313 | + | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
| 2320 | + | |
| 2321 | + | |
| 2322 | + | |
| 2323 | + | |
| 2324 | + | |
| 2325 | + | |
| 2326 | + | |
| 2327 | + | |
| 2328 | + | |
| 2329 | + | |
| 2330 | + | |
| 2331 | + | |
| 2332 | + | |
| 2333 | + | |
| 2334 | + | |
| 2335 | + | |
| 2336 | + | |
| 2337 | + | |
| 2338 | + | |
| 2339 | + | |
| 2340 | + | |
| 2341 | + | |
| 2342 | + | |
| 2343 | + | |
| 2344 | + | |
| 2345 | + | |
| 2346 | + | |
| 2347 | + | |
| 2348 | + | |
| 2349 | + | |
| 2350 | + | |
| 2351 | + | |
| 2352 | + | |
| 2353 | + | |
| 2354 | + | |
| 2355 | + | |
| 2356 | + | |
2312 | 2357 |
| |
2313 | 2358 |
| |
2314 | 2359 |
| |
|
Lines changed: 36 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1583 | 1583 |
| |
1584 | 1584 |
| |
1585 | 1585 |
| |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
1586 | 1622 |
| |
1587 | 1623 |
| |
1588 | 1624 |
| |
|
0 commit comments
Comments
(0)