forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit18865f4
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 parent2489c38 commit18865f4
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 | |
---|---|---|---|
| |||
9858 | 9858 |
| |
9859 | 9859 |
| |
9860 | 9860 |
| |
9861 |
| - | |
| 9861 | + | |
9862 | 9862 |
| |
9863 |
| - | |
9864 |
| - | |
9865 | 9863 |
| |
9866 | 9864 |
| |
9867 |
| - | |
| 9865 | + | |
| 9866 | + | |
| 9867 | + | |
| 9868 | + | |
9868 | 9869 |
| |
| 9870 | + | |
| 9871 | + | |
| 9872 | + | |
| 9873 | + | |
| 9874 | + | |
| 9875 | + | |
9869 | 9876 |
| |
9870 | 9877 |
| |
9871 | 9878 |
| |
| |||
10037 | 10044 |
| |
10038 | 10045 |
| |
10039 | 10046 |
| |
10040 |
| - | |
10041 |
| - | |
| 10047 | + | |
| 10048 | + | |
10042 | 10049 |
| |
10043 | 10050 |
| |
| 10051 | + | |
| 10052 | + | |
| 10053 | + | |
| 10054 | + | |
10044 | 10055 |
| |
| 10056 | + | |
| 10057 | + | |
| 10058 | + | |
| 10059 | + | |
| 10060 | + | |
| 10061 | + | |
10045 | 10062 |
| |
10046 | 10063 |
| |
10047 | 10064 |
| |
| |||
18019 | 18036 |
| |
18020 | 18037 |
| |
18021 | 18038 |
| |
| 18039 | + | |
18022 | 18040 |
| |
18023 |
| - | |
18024 |
| - | |
18025 | 18041 |
| |
18026 | 18042 |
| |
| 18043 | + | |
| 18044 | + | |
| 18045 | + | |
| 18046 | + | |
| 18047 | + | |
| 18048 | + | |
| 18049 | + | |
| 18050 | + | |
| 18051 | + | |
| 18052 | + | |
| 18053 | + | |
18027 | 18054 |
| |
18028 | 18055 |
| |
18029 | 18056 |
| |
|
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)