forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit35dd40d
committed
Improve tracking of role dependencies of pg_init_privs entries.
Commit5342874 invented SHARED_DEPENDENCY_INITACL entries inpg_shdepend, but installed them only for non-owner roles mentionedin a pg_init_privs entry. This turns out to be the wrong thing,because there is nothing to cue REASSIGN OWNED to go and updatepg_init_privs entries when the object's ownership is reassigned.That leads to leaving dangling entries in pg_init_privs, asreported by Hannu Krosing. Instead, install INITACL entries forall roles mentioned in pg_init_privs entries (except pinned roles),and change ALTER OWNER to not touch them, just as it doesn'ttouch pg_init_privs entries.REASSIGN OWNED will now substitute the new owner OID for the oldin pg_init_privs entries. This feels like perhaps not quite theright thing, since pg_init_privs ought to be a historical recordof the state of affairs just after CREATE EXTENSION. However,it's hard to see what else to do, if we don't want to disallowdropping the object's original owner. In any case this isbetter than the previous do-nothing behavior, and we're unlikelyto come up with a superior solution in time for v17.While here, tighten up some coding rules about how ACLs inpg_init_privs should never be null or empty. There's not anyobvious reason to allow that, and perhaps asserting that it'snot so will catch some bugs. (We were previously inconsistenton the point, with some code paths taking care not to storeempty ACLs and others not.)This leaves recordExtensionInitPrivWorker not doing anythingwith its ownerId argument, but we'll deal with that separately.catversion bump forced because of change of expected contentsof pg_shdepend when pg_init_privs entries exist.Discussion:https://postgr.es/m/CAMT0RQSVgv48G5GArUvOVhottWqZLrvC5wBzBa4HrUdXe9VRXw@mail.gmail.com1 parent653d396 commit35dd40d
File tree
9 files changed
+666
-111
lines changed- doc/src/sgml
- src
- backend
- catalog
- utils/adt
- include
- catalog
- utils
- test/modules/test_pg_dump
- expected
- sql
9 files changed
+666
-111
lines changedLines changed: 0 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7182 | 7182 |
| |
7183 | 7183 |
| |
7184 | 7184 |
| |
7185 |
| - | |
7186 |
| - | |
7187 |
| - | |
7188 | 7185 |
| |
7189 | 7186 |
| |
7190 | 7187 |
| |
|
Lines changed: 116 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4771 | 4771 |
| |
4772 | 4772 |
| |
4773 | 4773 |
| |
4774 |
| - | |
4775 |
| - | |
4776 |
| - | |
4777 |
| - | |
| 4774 | + | |
| 4775 | + | |
4778 | 4776 |
| |
4779 | 4777 |
| |
4780 | 4778 |
| |
4781 |
| - | |
4782 | 4779 |
| |
4783 | 4780 |
| |
4784 | 4781 |
| |
4785 | 4782 |
| |
4786 |
| - | |
| 4783 | + | |
4787 | 4784 |
| |
4788 | 4785 |
| |
4789 | 4786 |
| |
| |||
4795 | 4792 |
| |
4796 | 4793 |
| |
4797 | 4794 |
| |
4798 |
| - | |
| 4795 | + | |
4799 | 4796 |
| |
4800 | 4797 |
| |
4801 | 4798 |
| |
| |||
4810 | 4807 |
| |
4811 | 4808 |
| |
4812 | 4809 |
| |
4813 |
| - | |
| 4810 | + | |
4814 | 4811 |
| |
4815 | 4812 |
| |
4816 | 4813 |
| |
| |||
4832 | 4829 |
| |
4833 | 4830 |
| |
4834 | 4831 |
| |
4835 |
| - | |
4836 | 4832 |
| |
4837 | 4833 |
| |
4838 | 4834 |
| |
| |||
4846 | 4842 |
| |
4847 | 4843 |
| |
4848 | 4844 |
| |
| 4845 | + | |
| 4846 | + | |
| 4847 | + | |
| 4848 | + | |
| 4849 | + | |
| 4850 | + | |
| 4851 | + | |
| 4852 | + | |
| 4853 | + | |
| 4854 | + | |
| 4855 | + | |
| 4856 | + | |
| 4857 | + | |
| 4858 | + | |
| 4859 | + | |
| 4860 | + | |
| 4861 | + | |
| 4862 | + | |
| 4863 | + | |
| 4864 | + | |
| 4865 | + | |
| 4866 | + | |
| 4867 | + | |
| 4868 | + | |
| 4869 | + | |
| 4870 | + | |
| 4871 | + | |
| 4872 | + | |
| 4873 | + | |
| 4874 | + | |
| 4875 | + | |
| 4876 | + | |
| 4877 | + | |
| 4878 | + | |
| 4879 | + | |
| 4880 | + | |
| 4881 | + | |
| 4882 | + | |
| 4883 | + | |
| 4884 | + | |
| 4885 | + | |
| 4886 | + | |
| 4887 | + | |
| 4888 | + | |
| 4889 | + | |
| 4890 | + | |
| 4891 | + | |
| 4892 | + | |
| 4893 | + | |
| 4894 | + | |
| 4895 | + | |
| 4896 | + | |
| 4897 | + | |
| 4898 | + | |
| 4899 | + | |
| 4900 | + | |
| 4901 | + | |
| 4902 | + | |
| 4903 | + | |
| 4904 | + | |
| 4905 | + | |
| 4906 | + | |
| 4907 | + | |
| 4908 | + | |
| 4909 | + | |
| 4910 | + | |
| 4911 | + | |
| 4912 | + | |
| 4913 | + | |
| 4914 | + | |
| 4915 | + | |
| 4916 | + | |
| 4917 | + | |
| 4918 | + | |
| 4919 | + | |
| 4920 | + | |
| 4921 | + | |
| 4922 | + | |
| 4923 | + | |
| 4924 | + | |
| 4925 | + | |
| 4926 | + | |
| 4927 | + | |
| 4928 | + | |
| 4929 | + | |
| 4930 | + | |
| 4931 | + | |
| 4932 | + | |
| 4933 | + | |
| 4934 | + | |
| 4935 | + | |
| 4936 | + | |
| 4937 | + | |
| 4938 | + | |
| 4939 | + | |
| 4940 | + | |
| 4941 | + | |
| 4942 | + | |
| 4943 | + | |
| 4944 | + | |
| 4945 | + | |
| 4946 | + | |
| 4947 | + | |
| 4948 | + | |
| 4949 | + | |
| 4950 | + | |
| 4951 | + | |
| 4952 | + | |
| 4953 | + | |
4849 | 4954 |
| |
4850 | 4955 |
| |
4851 | 4956 |
| |
| |||
4907 | 5012 |
| |
4908 | 5013 |
| |
4909 | 5014 |
| |
4910 |
| - | |
4911 |
| - | |
4912 |
| - | |
4913 |
| - | |
| 5015 | + | |
| 5016 | + | |
4914 | 5017 |
| |
4915 | 5018 |
| |
4916 | 5019 |
| |
| |||
4972 | 5075 |
| |
4973 | 5076 |
| |
4974 | 5077 |
| |
4975 |
| - | |
4976 | 5078 |
| |
4977 | 5079 |
| |
4978 | 5080 |
| |
|
0 commit comments
Comments
(0)