- Notifications
You must be signed in to change notification settings - Fork5
Commit08dd23c
committed
Fix some issues with temp/transient tables in extension scripts.
Phil Sorber reported that a rewriting ALTER TABLE within an extensionupdate script failed, because it creates and then drops a placeholdertable; the drop was being disallowed because the table was marked as anextension member. We could hack that specific case but it seems likelythat there might be related cases now or in the future, so the mostpractical solution seems to be to create an exception to the general rulethat extension member objects can only be dropped by dropping the owningextension. To wit: if the DROP is issued within the extension's owncreation or update scripts, we'll allow it, implicitly performing an"ALTER EXTENSION DROP object" first. This will simplify cases such asextension downgrade scripts anyway.No docs change since we don't seem to have documented the idea that youwould need ALTER EXTENSION DROP for such an action to begin with.Also, arrange for explicitly temporary tables to not get linked asextension members in the first place, and the same for the magicpg_temp_nnn schemas that are created to hold them. This prevents assortedunpleasant results if an extension script creates a temp table: the forceddrop at session end would either fail or remove the entire extension, andneither of those outcomes is desirable. Note that this doesn't fix theALTER TABLE scenario, since the placeholder table is not temp (unless thetable being rewritten is).Back-patch to 9.1.1 parentc5e073c commit08dd23c
File tree
6 files changed
+51
-14
lines changed- src
- backend
- catalog
- commands
- include/catalog
6 files changed
+51
-14
lines changedLines changed: 25 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
560 | 560 |
| |
561 | 561 |
| |
562 | 562 |
| |
563 |
| - | |
564 |
| - | |
565 |
| - | |
566 |
| - | |
567 |
| - | |
568 |
| - | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
569 | 567 |
| |
570 | 568 |
| |
571 | 569 |
| |
572 | 570 |
| |
573 | 571 |
| |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
574 | 578 |
| |
575 | 579 |
| |
576 | 580 |
| |
| |||
579 | 583 |
| |
580 | 584 |
| |
581 | 585 |
| |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
582 | 601 |
| |
583 | 602 |
| |
584 | 603 |
| |
|
Lines changed: 8 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
957 | 957 |
| |
958 | 958 |
| |
959 | 959 |
| |
| 960 | + | |
960 | 961 |
| |
961 | 962 |
| |
962 | 963 |
| |
963 | 964 |
| |
| 965 | + | |
964 | 966 |
| |
965 | 967 |
| |
966 | 968 |
| |
| |||
1235 | 1237 |
| |
1236 | 1238 |
| |
1237 | 1239 |
| |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
1238 | 1244 |
| |
1239 | 1245 |
| |
1240 | 1246 |
| |
| |||
1255 | 1261 |
| |
1256 | 1262 |
| |
1257 | 1263 |
| |
1258 |
| - | |
| 1264 | + | |
| 1265 | + | |
1259 | 1266 |
| |
1260 | 1267 |
| |
1261 | 1268 |
| |
|
Lines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3558 | 3558 |
| |
3559 | 3559 |
| |
3560 | 3560 |
| |
3561 |
| - | |
| 3561 | + | |
| 3562 | + | |
3562 | 3563 |
| |
3563 | 3564 |
| |
3564 | 3565 |
| |
| |||
3582 | 3583 |
| |
3583 | 3584 |
| |
3584 | 3585 |
| |
3585 |
| - | |
| 3586 | + | |
| 3587 | + | |
3586 | 3588 |
| |
3587 | 3589 |
| |
3588 | 3590 |
| |
|
Lines changed: 12 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
29 | 37 |
| |
30 | 38 |
| |
31 | 39 |
| |
32 |
| - | |
| 40 | + | |
33 | 41 |
| |
34 | 42 |
| |
35 | 43 |
| |
| |||
82 | 90 |
| |
83 | 91 |
| |
84 | 92 |
| |
85 |
| - | |
86 |
| - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
87 | 96 |
| |
88 | 97 |
| |
89 | 98 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
94 | 94 |
| |
95 | 95 |
| |
96 | 96 |
| |
97 |
| - | |
| 97 | + | |
98 | 98 |
| |
99 | 99 |
| |
100 | 100 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
79 | 79 |
| |
80 | 80 |
| |
81 | 81 |
| |
82 |
| - | |
| 82 | + | |
83 | 83 |
| |
84 | 84 |
|
0 commit comments
Comments
(0)