forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb0284bf
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 parent2fe4c73 commitb0284bf
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 | |
---|---|---|---|
| |||
10092 | 10092 |
| |
10093 | 10093 |
| |
10094 | 10094 |
| |
10095 |
| - | |
| 10095 | + | |
10096 | 10096 |
| |
10097 |
| - | |
10098 |
| - | |
10099 | 10097 |
| |
10100 | 10098 |
| |
10101 |
| - | |
| 10099 | + | |
| 10100 | + | |
| 10101 | + | |
| 10102 | + | |
10102 | 10103 |
| |
| 10104 | + | |
| 10105 | + | |
| 10106 | + | |
| 10107 | + | |
| 10108 | + | |
| 10109 | + | |
| 10110 | + | |
10103 | 10111 |
| |
10104 | 10112 |
| |
10105 | 10113 |
| |
| |||
10317 | 10325 |
| |
10318 | 10326 |
| |
10319 | 10327 |
| |
10320 |
| - | |
10321 |
| - | |
| 10328 | + | |
| 10329 | + | |
10322 | 10330 |
| |
10323 | 10331 |
| |
| 10332 | + | |
| 10333 | + | |
| 10334 | + | |
| 10335 | + | |
10324 | 10336 |
| |
| 10337 | + | |
| 10338 | + | |
| 10339 | + | |
| 10340 | + | |
| 10341 | + | |
| 10342 | + | |
| 10343 | + | |
10325 | 10344 |
| |
10326 | 10345 |
| |
10327 | 10346 |
| |
| |||
18517 | 18536 |
| |
18518 | 18537 |
| |
18519 | 18538 |
| |
| 18539 | + | |
18520 | 18540 |
| |
18521 |
| - | |
18522 |
| - | |
18523 | 18541 |
| |
18524 | 18542 |
| |
| 18543 | + | |
| 18544 | + | |
| 18545 | + | |
| 18546 | + | |
| 18547 | + | |
| 18548 | + | |
| 18549 | + | |
| 18550 | + | |
| 18551 | + | |
| 18552 | + | |
| 18553 | + | |
| 18554 | + | |
18525 | 18555 |
| |
18526 | 18556 |
| |
18527 | 18557 |
| |
|
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)