forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc301e1c
committed
Create FKs properly when attaching table as partition
Commitf56f8f8 added some code in CloneFkReferencing that's way toolax about a Constraint node it manufactures, not initializing enoughstruct members -- initially_valid in particular was forgotten. Thiscauses some FKs in partitions added by ALTER TABLE ATTACH PARTITION tobe marked as not validated. Set initially_valid true, which fixes thebug.While at it, make the struct initialization more complete. Very similarcode was added in two other places by the same commit; make them allfollow the same pattern for consistency, though no bugs are apparentthere.This bug has never been reported: I only happened to notice whileworking on commit614a406. The test case that was added there withthe improper result is repaired.Backpatch to 12.Discussion:https://postgr.es/m/20221005105523.bhuhkdx4olajboof@alvherre.pgsql1 parentf2dc7f9 commitc301e1c
File tree
2 files changed
+40
-10
lines changed- src
- backend/commands
- test/regress/expected
2 files changed
+40
-10
lines changedLines changed: 38 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10126 | 10126 |
| |
10127 | 10127 |
| |
10128 | 10128 |
| |
10129 |
| - | |
| 10129 | + | |
10130 | 10130 |
| |
10131 |
| - | |
10132 |
| - | |
10133 | 10131 |
| |
10134 | 10132 |
| |
10135 |
| - | |
| 10133 | + | |
| 10134 | + | |
| 10135 | + | |
| 10136 | + | |
10136 | 10137 |
| |
| 10138 | + | |
| 10139 | + | |
| 10140 | + | |
| 10141 | + | |
| 10142 | + | |
| 10143 | + | |
| 10144 | + | |
10137 | 10145 |
| |
10138 | 10146 |
| |
10139 | 10147 |
| |
| |||
10351 | 10359 |
| |
10352 | 10360 |
| |
10353 | 10361 |
| |
10354 |
| - | |
10355 |
| - | |
| 10362 | + | |
| 10363 | + | |
10356 | 10364 |
| |
10357 | 10365 |
| |
| 10366 | + | |
| 10367 | + | |
| 10368 | + | |
| 10369 | + | |
10358 | 10370 |
| |
| 10371 | + | |
| 10372 | + | |
| 10373 | + | |
| 10374 | + | |
| 10375 | + | |
| 10376 | + | |
| 10377 | + | |
10359 | 10378 |
| |
10360 | 10379 |
| |
10361 | 10380 |
| |
| |||
18571 | 18590 |
| |
18572 | 18591 |
| |
18573 | 18592 |
| |
| 18593 | + | |
18574 | 18594 |
| |
18575 |
| - | |
18576 |
| - | |
18577 | 18595 |
| |
18578 | 18596 |
| |
| 18597 | + | |
| 18598 | + | |
| 18599 | + | |
| 18600 | + | |
| 18601 | + | |
| 18602 | + | |
| 18603 | + | |
| 18604 | + | |
| 18605 | + | |
| 18606 | + | |
| 18607 | + | |
| 18608 | + | |
18579 | 18609 |
| |
18580 | 18610 |
| |
18581 | 18611 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2031 | 2031 |
| |
2032 | 2032 |
| |
2033 | 2033 |
| |
2034 |
| - | |
| 2034 | + | |
2035 | 2035 |
| |
2036 | 2036 |
| |
2037 | 2037 |
| |
| |||
2060 | 2060 |
| |
2061 | 2061 |
| |
2062 | 2062 |
| |
2063 |
| - | |
| 2063 | + | |
2064 | 2064 |
| |
2065 | 2065 |
| |
2066 | 2066 |
| |
|
0 commit comments
Comments
(0)