- Notifications
You must be signed in to change notification settings - Fork5
Commit8d3b421
committed
Allow non-superusers to create (some) extensions.
Remove the unconditional superuser permissions check in CREATE EXTENSION,and instead define a "superuser" extension property, which when false(not the default) skips the superuser permissions check. In this casethe calling user only needs enough permissions to execute the commandsin the extension's installation script. The superuser property is alsoenforced in the same way for ALTER EXTENSION UPDATE cases.In other ALTER EXTENSION cases and DROP EXTENSION, test ownership ofthe extension rather than superuserness. ALTER EXTENSION ADD/DROP needsto insist on ownership of the target object as well; to do that withoutduplicating code, refactor comment.c's big switch for permissions checksinto a separate function in objectaddress.c.I also removed the superuserness checks in pg_available_extensions andrelated functions; there's no strong reason why everybody shouldn'tbe able to see that info.Also invent an IF NOT EXISTS variant of CREATE EXTENSION, and use thatin pg_dump, so that dumps won't fail for installed-by-default extensions.We don't have any of those yet, but we will soon.This is all per discussion of wrapping the standard procedural languagesinto extensions. I'll make those changes in a separate commit; this isjust putting the core infrastructure in place.1 parent4442e19 commit8d3b421
File tree
20 files changed
+410
-293
lines changed- doc/src/sgml
- ref
- src
- backend
- catalog
- commands
- nodes
- parser
- bin/pg_dump
- include
- catalog
- nodes
- utils
- test/regress/expected
20 files changed
+410
-293
lines changedLines changed: 10 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6460 | 6460 |
| |
6461 | 6461 |
| |
6462 | 6462 |
| |
6463 |
| - | |
6464 |
| - | |
| 6463 | + | |
| 6464 | + | |
6465 | 6465 |
| |
6466 | 6466 |
| |
6467 | 6467 |
| |
| |||
6522 | 6522 |
| |
6523 | 6523 |
| |
6524 | 6524 |
| |
6525 |
| - | |
6526 |
| - | |
| 6525 | + | |
| 6526 | + | |
6527 | 6527 |
| |
6528 | 6528 |
| |
6529 | 6529 |
| |
| |||
6560 | 6560 |
| |
6561 | 6561 |
| |
6562 | 6562 |
| |
| 6563 | + | |
| 6564 | + | |
| 6565 | + | |
| 6566 | + | |
| 6567 | + | |
| 6568 | + | |
6563 | 6569 |
| |
6564 | 6570 |
| |
6565 | 6571 |
| |
|
Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
463 | 463 |
| |
464 | 464 |
| |
465 | 465 |
| |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
466 | 479 |
| |
467 | 480 |
| |
468 | 481 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
114 | 114 |
| |
115 | 115 |
| |
116 | 116 |
| |
117 |
| - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
118 | 120 |
| |
119 | 121 |
| |
120 | 122 |
| |
|
Lines changed: 19 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
21 | 21 |
| |
22 | 22 |
| |
23 | 23 |
| |
24 |
| - | |
| 24 | + | |
25 | 25 |
| |
26 | 26 |
| |
27 | 27 |
| |
| |||
51 | 51 |
| |
52 | 52 |
| |
53 | 53 |
| |
54 |
| - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
55 | 60 |
| |
56 | 61 |
| |
57 | 62 |
| |
| |||
60 | 65 |
| |
61 | 66 |
| |
62 | 67 |
| |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
63 | 80 |
| |
64 | 81 |
| |
65 | 82 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
34 | 34 |
| |
35 | 35 |
| |
36 | 36 |
| |
37 |
| - | |
| 37 | + | |
38 | 38 |
| |
39 | 39 |
| |
40 | 40 |
| |
|
Lines changed: 47 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
29 | 29 |
| |
30 | 30 |
| |
31 | 31 |
| |
| 32 | + | |
32 | 33 |
| |
33 | 34 |
| |
34 | 35 |
| |
| |||
3148 | 3149 |
| |
3149 | 3150 |
| |
3150 | 3151 |
| |
| 3152 | + | |
| 3153 | + | |
3151 | 3154 |
| |
3152 | 3155 |
| |
3153 | 3156 |
| |
| |||
3192 | 3195 |
| |
3193 | 3196 |
| |
3194 | 3197 |
| |
| 3198 | + | |
| 3199 | + | |
3195 | 3200 |
| |
3196 | 3201 |
| |
3197 | 3202 |
| |
| |||
4688 | 4693 |
| |
4689 | 4694 |
| |
4690 | 4695 |
| |
| 4696 | + | |
| 4697 | + | |
| 4698 | + | |
| 4699 | + | |
| 4700 | + | |
| 4701 | + | |
| 4702 | + | |
| 4703 | + | |
| 4704 | + | |
| 4705 | + | |
| 4706 | + | |
| 4707 | + | |
| 4708 | + | |
| 4709 | + | |
| 4710 | + | |
| 4711 | + | |
| 4712 | + | |
| 4713 | + | |
| 4714 | + | |
| 4715 | + | |
| 4716 | + | |
| 4717 | + | |
| 4718 | + | |
| 4719 | + | |
| 4720 | + | |
| 4721 | + | |
| 4722 | + | |
| 4723 | + | |
| 4724 | + | |
| 4725 | + | |
| 4726 | + | |
| 4727 | + | |
| 4728 | + | |
| 4729 | + | |
| 4730 | + | |
| 4731 | + | |
| 4732 | + | |
| 4733 | + | |
| 4734 | + | |
| 4735 | + | |
| 4736 | + | |
| 4737 | + | |
4691 | 4738 |
| |
4692 | 4739 |
| |
4693 | 4740 |
| |
|
Lines changed: 151 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
52 | 52 |
| |
53 | 53 |
| |
54 | 54 |
| |
| 55 | + | |
| 56 | + | |
55 | 57 |
| |
56 | 58 |
| |
57 | 59 |
| |
| |||
78 | 80 |
| |
79 | 81 |
| |
80 | 82 |
| |
| 83 | + | |
81 | 84 |
| |
82 | 85 |
| |
83 | 86 |
| |
| |||
688 | 691 |
| |
689 | 692 |
| |
690 | 693 |
| |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + |
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
161 | 161 |
| |
162 | 162 |
| |
163 | 163 |
| |
164 |
| - | |
| 164 | + | |
165 | 165 |
| |
166 | 166 |
| |
167 | 167 |
| |
|
0 commit comments
Comments
(0)