forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0464fdf
committed
Create action triggers when partitions are detached
Detaching a partition from a partitioned table that's constrained byforeign keys requires additional action triggers on the referenced side;otherwise, DELETE/UPDATE actions there fail to notice rows in the tablethat was partition, and so are incorrectly allowed through. With thiscommit, those triggers are now created. Conversely, when a table thathas a foreign key is attached as a partition to a table that also hasthe same foreign key, those action triggers are no longer needed, so weremove them.Add a minimal test case verifying (part of) this.Authors: Amit Langote, Álvaro HerreraDiscussion:https://postgr.es/m/f2b8ead5-4131-d5a8-8016-2ea0a31250af@lab.ntt.co.jp1 parent1755440 commit0464fdf
File tree
3 files changed
+113
-5
lines changed- src
- backend/commands
- test/regress
- expected
- sql
3 files changed
+113
-5
lines changedLines changed: 69 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7851 | 7851 |
| |
7852 | 7852 |
| |
7853 | 7853 |
| |
| 7854 | + | |
| 7855 | + | |
| 7856 | + | |
| 7857 | + | |
7854 | 7858 |
| |
7855 | 7859 |
| |
7856 | 7860 |
| |
| |||
7902 | 7906 |
| |
7903 | 7907 |
| |
7904 | 7908 |
| |
7905 |
| - | |
| 7909 | + | |
| 7910 | + | |
| 7911 | + | |
| 7912 | + | |
| 7913 | + | |
| 7914 | + | |
| 7915 | + | |
| 7916 | + | |
| 7917 | + | |
| 7918 | + | |
| 7919 | + | |
| 7920 | + | |
| 7921 | + | |
| 7922 | + | |
| 7923 | + | |
| 7924 | + | |
| 7925 | + | |
| 7926 | + | |
| 7927 | + | |
| 7928 | + | |
| 7929 | + | |
| 7930 | + | |
| 7931 | + | |
| 7932 | + | |
| 7933 | + | |
| 7934 | + | |
| 7935 | + | |
| 7936 | + | |
| 7937 | + | |
| 7938 | + | |
| 7939 | + | |
| 7940 | + | |
| 7941 | + | |
7906 | 7942 |
| |
7907 | 7943 |
| |
7908 | 7944 |
| |
| |||
15073 | 15109 |
| |
15074 | 15110 |
| |
15075 | 15111 |
| |
15076 |
| - | |
| 15112 | + | |
| 15113 | + | |
| 15114 | + | |
| 15115 | + | |
15077 | 15116 |
| |
15078 | 15117 |
| |
15079 | 15118 |
| |
15080 | 15119 |
| |
15081 | 15120 |
| |
| 15121 | + | |
| 15122 | + | |
15082 | 15123 |
| |
15083 | 15124 |
| |
15084 | 15125 |
| |
15085 | 15126 |
| |
| 15127 | + | |
| 15128 | + | |
| 15129 | + | |
| 15130 | + | |
| 15131 | + | |
| 15132 | + | |
| 15133 | + | |
| 15134 | + | |
| 15135 | + | |
15086 | 15136 |
| |
| 15137 | + | |
15087 | 15138 |
| |
15088 | 15139 |
| |
| 15140 | + | |
| 15141 | + | |
| 15142 | + | |
| 15143 | + | |
| 15144 | + | |
| 15145 | + | |
| 15146 | + | |
| 15147 | + | |
| 15148 | + | |
| 15149 | + | |
| 15150 | + | |
| 15151 | + | |
| 15152 | + | |
| 15153 | + | |
| 15154 | + | |
| 15155 | + | |
15089 | 15156 |
| |
15090 | 15157 |
| |
15091 | 15158 |
| |
|
Lines changed: 26 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1921 | 1921 |
| |
1922 | 1922 |
| |
1923 | 1923 |
| |
| 1924 | + | |
| 1925 | + | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
| 1930 | + | |
| 1931 | + | |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
| 1944 | + | |
| 1945 | + | |
| 1946 | + | |
| 1947 | + | |
1924 | 1948 |
| |
1925 |
| - | |
1926 |
| - | |
| 1949 | + | |
| 1950 | + | |
1927 | 1951 |
|
Lines changed: 18 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1375 | 1375 |
| |
1376 | 1376 |
| |
1377 | 1377 |
| |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
1378 | 1395 |
| |
1379 |
| - | |
| 1396 | + | |
1380 | 1397 |
|
0 commit comments
Comments
(0)