forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitade2409
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 parentdd38ff2 commitade2409
File tree
3 files changed
+52
-10
lines changed- src
- backend/commands
- test/regress
- expected
- sql
3 files changed
+52
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10338 | 10338 | | |
10339 | 10339 | | |
10340 | 10340 | | |
10341 | | - | |
10342 | | - | |
10343 | | - | |
10344 | | - | |
10345 | | - | |
10346 | | - | |
10347 | | - | |
10348 | | - | |
10349 | | - | |
10350 | | - | |
10351 | 10341 | | |
10352 | 10342 | | |
10353 | 10343 | | |
| |||
10362 | 10352 | | |
10363 | 10353 | | |
10364 | 10354 | | |
| 10355 | + | |
| 10356 | + | |
| 10357 | + | |
| 10358 | + | |
| 10359 | + | |
| 10360 | + | |
| 10361 | + | |
| 10362 | + | |
| 10363 | + | |
| 10364 | + | |
10365 | 10365 | | |
10366 | 10366 | | |
10367 | 10367 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
603 | 603 | | |
604 | 604 | | |
605 | 605 | | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
606 | 629 | | |
607 | 630 | | |
608 | 631 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
433 | 452 | | |
434 | 453 | | |
435 | 454 | | |
| |||
0 commit comments
Comments
(0)