forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit1635e80
committed
Use a blacklist to distinguish original from add-on enum values.
Commit15bc038 allowed ALTER TYPE ADD VALUE to be executed insidetransaction blocks, by disallowing the use of the added value laterin the same transaction, except under limited circumstances. However,the test for "limited circumstances" was heuristic and could rejectreferences to enum values that were created during CREATE TYPE AS ENUM,not just later. This breaks the use-case of restoring pg_dump scriptsin a single transaction, as reported in bug #14825 from Balazs Szilfai.We can improve this by keeping a "blacklist" table of enum value OIDscreated by ALTER TYPE ADD VALUE during the current transaction. Anyvisible-but-uncommitted value whose OID is not in the blacklist musthave been created by CREATE TYPE AS ENUM, and can be used safelybecause it could not have a lifespan shorter than its parent enum type.This change also removes the restriction that a renamed enum valuecan't be used before being committed (unless it was on the blacklist).Andrew Dunstan, with cosmetic improvements by me.Back-patch to v10.Discussion:https://postgr.es/m/20170922185904.1448.16585@wrigleys.postgresql.org1 parent15a8010 commit1635e80
7 files changed
+113
-2
lines changedLines changed: 0 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
294 | 294 |
| |
295 | 295 |
| |
296 | 296 |
| |
297 |
| - | |
298 |
| - | |
299 | 297 |
| |
300 | 298 |
| |
301 | 299 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
32 | 32 |
| |
33 | 33 |
| |
34 | 34 |
| |
| 35 | + | |
35 | 36 |
| |
36 | 37 |
| |
37 | 38 |
| |
| |||
2128 | 2129 |
| |
2129 | 2130 |
| |
2130 | 2131 |
| |
| 2132 | + | |
2131 | 2133 |
| |
2132 | 2134 |
| |
2133 | 2135 |
| |
| |||
2406 | 2408 |
| |
2407 | 2409 |
| |
2408 | 2410 |
| |
| 2411 | + | |
2409 | 2412 |
| |
2410 | 2413 |
| |
2411 | 2414 |
| |
| |||
2608 | 2611 |
| |
2609 | 2612 |
| |
2610 | 2613 |
| |
| 2614 | + | |
2611 | 2615 |
| |
2612 | 2616 |
| |
2613 | 2617 |
| |
|
Lines changed: 64 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
28 | 28 |
| |
29 | 29 |
| |
30 | 30 |
| |
| 31 | + | |
| 32 | + | |
31 | 33 |
| |
32 | 34 |
| |
33 | 35 |
| |
34 | 36 |
| |
35 | 37 |
| |
36 | 38 |
| |
37 | 39 |
| |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
38 | 51 |
| |
39 | 52 |
| |
40 | 53 |
| |
| |||
460 | 473 |
| |
461 | 474 |
| |
462 | 475 |
| |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
463 | 494 |
| |
464 | 495 |
| |
465 | 496 |
| |
| |||
547 | 578 |
| |
548 | 579 |
| |
549 | 580 |
| |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
550 | 614 |
| |
551 | 615 |
| |
552 | 616 |
| |
|
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
76 | 76 |
| |
77 | 77 |
| |
78 | 78 |
| |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
79 | 88 |
| |
80 | 89 |
| |
81 | 90 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
69 | 69 |
| |
70 | 70 |
| |
71 | 71 |
| |
| 72 | + | |
| 73 | + | |
72 | 74 |
| |
73 | 75 |
|
Lines changed: 21 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
633 | 633 |
| |
634 | 634 |
| |
635 | 635 |
| |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
636 | 646 |
| |
637 | 647 |
| |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
638 | 659 |
| |
639 | 660 |
| |
640 | 661 |
| |
|
Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
300 | 300 |
| |
301 | 301 |
| |
302 | 302 |
| |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
303 | 309 |
| |
304 | 310 |
| |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
305 | 318 |
| |
306 | 319 |
| |
307 | 320 |
| |
|
0 commit comments
Comments
(0)