forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite5bc945
committed
Explicitly list dependent types as extension members in pg_depend.
Auto-generated array types, multirange types, and relation rowtypesare treated as dependent objects: they can't be dropped separatelyfrom the base object, nor can they have their own ownership orpermissions. We previously felt that, for objects that are in anextension, only the base object needs to be listed as an extensionmember in pg_depend. While that's sufficient to prevent inappropriatedrops, it results in undesirable answers if someone asks whether adependent type belongs to the extension. It looks like the dependenttype is just some random separately-created object that happens todepend on the base object. Notably, this results in postgres_fdwconcluding that expressions involving an array type are not shippableto the remote server, even when the defining extension has beenwhitelisted.To fix, cause GenerateTypeDependencies to make extension dependenciesfor dependent types as well as their base objects, and adjustExecAlterExtensionContentsStmt so that object addition and removaloperations recurse to dependent types. The latter change means thatpg_upgrade of a type-defining extension will end with the dependenttype(s) now also listed as extension members, even if they werenot that way in the source database. Normally we want pg_upgradeto precisely reproduce the source extension's state, but it seemsdesirable to make an exception here.This is arguably a bug fix, but we can't back-patch it since itcauses changes in the expected contents of pg_depend. (Becauseit does, I've bumped catversion, even though there's no changein the immediate post-initdb catalog contents.)Tom Lane and David GeierDiscussion:https://postgr.es/m/4a847c55-489f-4e8d-a664-fc6b1cbe306f@gmail.com1 parentdc8f2d7 commite5bc945
File tree
9 files changed
+265
-25
lines changed- src
- backend
- catalog
- commands
- include/catalog
- test/modules/test_extensions
- expected
- sql
9 files changed
+265
-25
lines changedLines changed: 12 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
539 | 539 |
| |
540 | 540 |
| |
541 | 541 |
| |
542 |
| - | |
| 542 | + | |
543 | 543 |
| |
544 | 544 |
| |
545 | 545 |
| |
| |||
599 | 599 |
| |
600 | 600 |
| |
601 | 601 |
| |
602 |
| - | |
| 602 | + | |
603 | 603 |
| |
604 | 604 |
| |
605 | 605 |
| |
| |||
624 | 624 |
| |
625 | 625 |
| |
626 | 626 |
| |
627 |
| - | |
628 |
| - | |
629 |
| - | |
630 | 627 |
| |
631 | 628 |
| |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
632 | 639 |
| |
633 | 640 |
| |
634 | 641 |
| |
|
Lines changed: 73 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
129 | 129 |
| |
130 | 130 |
| |
131 | 131 |
| |
| 132 | + | |
| 133 | + | |
| 134 | + | |
132 | 135 |
| |
133 | 136 |
| |
134 | 137 |
| |
| |||
3292 | 3295 |
| |
3293 | 3296 |
| |
3294 | 3297 |
| |
3295 |
| - | |
3296 | 3298 |
| |
3297 | 3299 |
| |
3298 | 3300 |
| |
| |||
3347 | 3349 |
| |
3348 | 3350 |
| |
3349 | 3351 |
| |
| 3352 | + | |
| 3353 | + | |
| 3354 | + | |
| 3355 | + | |
| 3356 | + | |
| 3357 | + | |
| 3358 | + | |
| 3359 | + | |
| 3360 | + | |
| 3361 | + | |
| 3362 | + | |
| 3363 | + | |
| 3364 | + | |
| 3365 | + | |
| 3366 | + | |
| 3367 | + | |
| 3368 | + | |
| 3369 | + | |
| 3370 | + | |
| 3371 | + | |
| 3372 | + | |
| 3373 | + | |
| 3374 | + | |
| 3375 | + | |
| 3376 | + | |
| 3377 | + | |
| 3378 | + | |
| 3379 | + | |
| 3380 | + | |
| 3381 | + | |
| 3382 | + | |
| 3383 | + | |
3350 | 3384 |
| |
3351 | 3385 |
| |
3352 | 3386 |
| |
| |||
3430 | 3464 |
| |
3431 | 3465 |
| |
3432 | 3466 |
| |
3433 |
| - | |
3434 |
| - | |
3435 | 3467 |
| |
3436 |
| - | |
3437 |
| - | |
3438 |
| - | |
3439 |
| - | |
| 3468 | + | |
| 3469 | + | |
| 3470 | + | |
3440 | 3471 |
| |
3441 |
| - | |
3442 |
| - | |
| 3472 | + | |
| 3473 | + | |
| 3474 | + | |
3443 | 3475 |
| |
3444 |
| - | |
| 3476 | + | |
| 3477 | + | |
| 3478 | + | |
| 3479 | + | |
| 3480 | + | |
| 3481 | + | |
| 3482 | + | |
| 3483 | + | |
| 3484 | + | |
| 3485 | + | |
| 3486 | + | |
| 3487 | + | |
| 3488 | + | |
| 3489 | + | |
| 3490 | + | |
| 3491 | + | |
| 3492 | + | |
| 3493 | + | |
| 3494 | + | |
| 3495 | + | |
| 3496 | + | |
| 3497 | + | |
| 3498 | + | |
| 3499 | + | |
| 3500 | + | |
| 3501 | + | |
| 3502 | + | |
| 3503 | + | |
| 3504 | + | |
| 3505 | + | |
| 3506 | + | |
| 3507 | + | |
3445 | 3508 |
| |
3446 | 3509 |
| |
3447 | 3510 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
57 | 57 |
| |
58 | 58 |
| |
59 | 59 |
| |
60 |
| - | |
| 60 | + | |
61 | 61 |
| |
62 | 62 |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
7 |
| - | |
| 7 | + | |
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
| |||
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
| 16 | + | |
16 | 17 |
| |
17 | 18 |
| |
18 | 19 |
| |
|
0 commit comments
Comments
(0)