forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitab70b3a
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 parentd9ffccf commitab70b3a
File tree
2 files changed
+37
-10
lines changed- src
- backend/commands
- test/regress/expected
2 files changed
+37
-10
lines changedLines changed: 35 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9010 | 9010 |
| |
9011 | 9011 |
| |
9012 | 9012 |
| |
9013 |
| - | |
| 9013 | + | |
9014 | 9014 |
| |
9015 |
| - | |
9016 |
| - | |
9017 | 9015 |
| |
9018 | 9016 |
| |
9019 |
| - | |
| 9017 | + | |
| 9018 | + | |
| 9019 | + | |
| 9020 | + | |
9020 | 9021 |
| |
| 9022 | + | |
| 9023 | + | |
| 9024 | + | |
| 9025 | + | |
| 9026 | + | |
| 9027 | + | |
9021 | 9028 |
| |
9022 | 9029 |
| |
9023 | 9030 |
| |
| |||
9190 | 9197 |
| |
9191 | 9198 |
| |
9192 | 9199 |
| |
9193 |
| - | |
9194 |
| - | |
| 9200 | + | |
| 9201 | + | |
9195 | 9202 |
| |
9196 | 9203 |
| |
| 9204 | + | |
| 9205 | + | |
| 9206 | + | |
| 9207 | + | |
9197 | 9208 |
| |
| 9209 | + | |
| 9210 | + | |
| 9211 | + | |
| 9212 | + | |
| 9213 | + | |
| 9214 | + | |
9198 | 9215 |
| |
9199 | 9216 |
| |
9200 | 9217 |
| |
| |||
17005 | 17022 |
| |
17006 | 17023 |
| |
17007 | 17024 |
| |
| 17025 | + | |
17008 | 17026 |
| |
17009 |
| - | |
17010 |
| - | |
17011 | 17027 |
| |
17012 | 17028 |
| |
| 17029 | + | |
| 17030 | + | |
| 17031 | + | |
| 17032 | + | |
| 17033 | + | |
| 17034 | + | |
| 17035 | + | |
| 17036 | + | |
| 17037 | + | |
| 17038 | + | |
| 17039 | + | |
17013 | 17040 |
| |
17014 | 17041 |
| |
17015 | 17042 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1960 | 1960 |
| |
1961 | 1961 |
| |
1962 | 1962 |
| |
1963 |
| - | |
| 1963 | + | |
1964 | 1964 |
| |
1965 | 1965 |
| |
1966 | 1966 |
| |
| |||
1989 | 1989 |
| |
1990 | 1990 |
| |
1991 | 1991 |
| |
1992 |
| - | |
| 1992 | + | |
1993 | 1993 |
| |
1994 | 1994 |
| |
1995 | 1995 |
| |
|
0 commit comments
Comments
(0)