forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit41b6e7c
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 parentb00f342 commit41b6e7c
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 | |
---|---|---|---|
| |||
9465 | 9465 |
| |
9466 | 9466 |
| |
9467 | 9467 |
| |
9468 |
| - | |
| 9468 | + | |
9469 | 9469 |
| |
9470 |
| - | |
9471 |
| - | |
9472 | 9470 |
| |
9473 | 9471 |
| |
9474 |
| - | |
| 9472 | + | |
| 9473 | + | |
| 9474 | + | |
| 9475 | + | |
9475 | 9476 |
| |
| 9477 | + | |
| 9478 | + | |
| 9479 | + | |
| 9480 | + | |
| 9481 | + | |
| 9482 | + | |
9476 | 9483 |
| |
9477 | 9484 |
| |
9478 | 9485 |
| |
| |||
9644 | 9651 |
| |
9645 | 9652 |
| |
9646 | 9653 |
| |
9647 |
| - | |
9648 |
| - | |
| 9654 | + | |
| 9655 | + | |
9649 | 9656 |
| |
9650 | 9657 |
| |
| 9658 | + | |
| 9659 | + | |
| 9660 | + | |
| 9661 | + | |
9651 | 9662 |
| |
| 9663 | + | |
| 9664 | + | |
| 9665 | + | |
| 9666 | + | |
| 9667 | + | |
| 9668 | + | |
9652 | 9669 |
| |
9653 | 9670 |
| |
9654 | 9671 |
| |
| |||
17401 | 17418 |
| |
17402 | 17419 |
| |
17403 | 17420 |
| |
| 17421 | + | |
17404 | 17422 |
| |
17405 |
| - | |
17406 |
| - | |
17407 | 17423 |
| |
17408 | 17424 |
| |
| 17425 | + | |
| 17426 | + | |
| 17427 | + | |
| 17428 | + | |
| 17429 | + | |
| 17430 | + | |
| 17431 | + | |
| 17432 | + | |
| 17433 | + | |
| 17434 | + | |
| 17435 | + | |
17409 | 17436 |
| |
17410 | 17437 |
| |
17411 | 17438 |
| |
|
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)