Commit 16f6906
committed
Remove bogus restriction from BEFORE UPDATE triggers
In trying to protect the user from inconsistent behavior, commit
487e986 "Enable BEFORE row-level triggers for partitioned tables"
tried to prevent BEFORE UPDATE FOR EACH ROW triggers from moving the row
from one partition to another. However, it turns out that the
restriction is wrong in two ways: first, it fails spuriously, preventing
valid situations from working, as in bug #16794; and second, they don't
protect from any misbehavior, because tuple routing would cope anyway.
Fix by removing that restriction.
We keep the same restriction on BEFORE INSERT FOR EACH ROW triggers,
though. It is valid and useful there. In the future we could remove it
by having tuple reroute work for inserts as it does for updates.
Backpatch to 13.
Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
Reported-by: Phillip Menke <pg@pmenke.de>
Discussion: https://postgr.es/m/16794-350a655580fbb9ae@postgresql.org1 parent 7f1921c commit 16f6906
File tree
4 files changed
+77
-22
lines changed- doc/src/sgml
- src
- backend/commands
- test/regress
- expected
- sql
4 files changed
+77
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4026 | 4026 | | |
4027 | 4027 | | |
4028 | 4028 | | |
4029 | | - | |
4030 | | - | |
| 4029 | + | |
| 4030 | + | |
4031 | 4031 | | |
4032 | 4032 | | |
4033 | 4033 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2726 | 2726 | | |
2727 | 2727 | | |
2728 | 2728 | | |
2729 | | - | |
2730 | | - | |
2731 | | - | |
2732 | | - | |
2733 | | - | |
2734 | | - | |
2735 | | - | |
2736 | | - | |
2737 | | - | |
2738 | | - | |
2739 | 2729 | | |
2740 | 2730 | | |
2741 | 2731 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2359 | 2359 | | |
2360 | 2360 | | |
2361 | 2361 | | |
2362 | | - | |
2363 | | - | |
| 2362 | + | |
| 2363 | + | |
2364 | 2364 | | |
2365 | 2365 | | |
2366 | 2366 | | |
| |||
2371 | 2371 | | |
2372 | 2372 | | |
2373 | 2373 | | |
2374 | | - | |
2375 | | - | |
| 2374 | + | |
| 2375 | + | |
2376 | 2376 | | |
2377 | 2377 | | |
2378 | | - | |
| 2378 | + | |
2379 | 2379 | | |
2380 | 2380 | | |
2381 | 2381 | | |
2382 | 2382 | | |
2383 | 2383 | | |
2384 | 2384 | | |
2385 | | - | |
2386 | | - | |
2387 | | - | |
2388 | | - | |
| 2385 | + | |
| 2386 | + | |
| 2387 | + | |
| 2388 | + | |
2389 | 2389 | | |
2390 | 2390 | | |
| 2391 | + | |
| 2392 | + | |
| 2393 | + | |
| 2394 | + | |
| 2395 | + | |
| 2396 | + | |
| 2397 | + | |
| 2398 | + | |
| 2399 | + | |
| 2400 | + | |
| 2401 | + | |
| 2402 | + | |
| 2403 | + | |
| 2404 | + | |
| 2405 | + | |
| 2406 | + | |
| 2407 | + | |
| 2408 | + | |
| 2409 | + | |
| 2410 | + | |
| 2411 | + | |
| 2412 | + | |
| 2413 | + | |
| 2414 | + | |
| 2415 | + | |
| 2416 | + | |
| 2417 | + | |
| 2418 | + | |
| 2419 | + | |
| 2420 | + | |
| 2421 | + | |
| 2422 | + | |
| 2423 | + | |
| 2424 | + | |
| 2425 | + | |
| 2426 | + | |
| 2427 | + | |
| 2428 | + | |
| 2429 | + | |
2391 | 2430 | | |
2392 | 2431 | | |
2393 | 2432 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1633 | 1633 | | |
1634 | 1634 | | |
1635 | 1635 | | |
1636 | | - | |
| 1636 | + | |
1637 | 1637 | | |
1638 | 1638 | | |
1639 | 1639 | | |
1640 | 1640 | | |
1641 | 1641 | | |
1642 | 1642 | | |
1643 | 1643 | | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
1644 | 1670 | | |
1645 | 1671 | | |
1646 | 1672 | | |
| |||
0 commit comments