forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit640c20d
committed
Choose FK name correctly during partition attachment
During ALTER TABLE ATTACH PARTITION, if the name of a parent's foreignkey constraint is already used on the partition, the code tries tochoose another one before the FK attributes list has been populated,so the resulting constraint name was "<relname>__fkey" instead of"<relname>_<attrs>_fkey". Repair, and add a test case.Backpatch to 12. In 11, the code to attach a partition was not smartenough to cope with conflicting constraint names, so the problem doesn'texist there.Author: Jehan-Guillaume de Rorthais <jgdr@dalibo.com>Discussion:https://postgr.es/m/20220901184156.738ebee5@karst1 parenta254545 commit640c20d
File tree
3 files changed
+52
-10
lines changed- src
- backend/commands
- test/regress
- input
- output
3 files changed
+52
-10
lines changedLines changed: 10 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10024 | 10024 |
| |
10025 | 10025 |
| |
10026 | 10026 |
| |
10027 |
| - | |
10028 |
| - | |
10029 |
| - | |
10030 |
| - | |
10031 |
| - | |
10032 |
| - | |
10033 |
| - | |
10034 |
| - | |
10035 |
| - | |
10036 |
| - | |
10037 | 10027 |
| |
10038 | 10028 |
| |
10039 | 10029 |
| |
| |||
10048 | 10038 |
| |
10049 | 10039 |
| |
10050 | 10040 |
| |
| 10041 | + | |
| 10042 | + | |
| 10043 | + | |
| 10044 | + | |
| 10045 | + | |
| 10046 | + | |
| 10047 | + | |
| 10048 | + | |
| 10049 | + | |
| 10050 | + | |
10051 | 10051 |
| |
10052 | 10052 |
| |
10053 | 10053 |
| |
|
Lines changed: 19 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
410 | 410 |
| |
411 | 411 |
| |
412 | 412 |
| |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
413 | 432 |
| |
414 | 433 |
| |
415 | 434 |
| |
|
Lines changed: 23 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
575 | 575 |
| |
576 | 576 |
| |
577 | 577 |
| |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
578 | 601 |
| |
579 | 602 |
| |
580 | 603 |
| |
|
0 commit comments
Comments
(0)