forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita7fcb62
committed
Fix some inappropriately-disallowed uses of ALTER ROLE/DATABASE SET.
Most GUC check hooks that inspect database state have special checksthat prevent them from throwing hard errors for state-dependent issueswhen source == PGC_S_TEST. This allows, for example,"ALTER DATABASE d SET default_text_search_config = foo" when the "foo"configuration hasn't been created yet. Without this, we have problemsduring dump/reload or pg_upgrade, because pg_dump has no idea aboutpossible dependencies of GUC values and can't ensure a safe restoreordering.However, check_role() and check_session_authorization() hadn't gottenthe memo about that, and would throw hard errors anyway. It's notentirely clear what is the use-case for "ALTER ROLE x SET role = y",but we've now heard two independent complaints about that bollixingan upgrade, so apparently some people are doing it.Hence, fix these two functions to act more like other check hookswith similar needs. (But I did not change their insistence onbeing inside a transaction, as it's still not apparent that settingeither GUC from the configuration file would be wise.)Also fix check_temp_buffers, which had a different form of the diseaseof making state-dependent checks without any exception for PGC_S_TEST.A cursory survey of other GUC check hooks did not find any more issuesof this ilk. (There are a lot of interdependencies amongPGC_POSTMASTER and PGC_SIGHUP GUCs, which may be a bad idea, butthey're not relevant to the immediate concern because they can't beset via ALTER ROLE/DATABASE.)Per reports from Charlie Hornsby and Nathan Bossart. Back-patchto all supported branches.Discussion:https://postgr.es/m/HE1P189MB0523B31598B0C772C908088DB7709@HE1P189MB0523.EURP189.PROD.OUTLOOK.COMDiscussion:https://postgr.es/m/20160711223641.1426.86096@wrigleys.postgresql.org1 parent6530df6 commita7fcb62
2 files changed
+34
-1
lines changedLines changed: 32 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
767 | 767 |
| |
768 | 768 |
| |
769 | 769 |
| |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
770 | 781 |
| |
771 | 782 |
| |
772 | 783 |
| |
| |||
837 | 848 |
| |
838 | 849 |
| |
839 | 850 |
| |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
840 | 857 |
| |
841 | 858 |
| |
842 | 859 |
| |
843 | 860 |
| |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
844 | 868 |
| |
845 | 869 |
| |
846 | 870 |
| |
| |||
859 | 883 |
| |
860 | 884 |
| |
861 | 885 |
| |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
862 | 894 |
| |
863 | 895 |
| |
864 | 896 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
11095 | 11095 |
| |
11096 | 11096 |
| |
11097 | 11097 |
| |
| 11098 | + | |
11098 | 11099 |
| |
11099 |
| - | |
| 11100 | + | |
11100 | 11101 |
| |
11101 | 11102 |
| |
11102 | 11103 |
| |
|
0 commit comments
Comments
(0)