forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2d870b4
committed
Allow ALTER SYSTEM to set unrecognized custom GUCs.
Previously, ALTER SYSTEM failed if the target GUC wasn't present inthe session's GUC hashtable. That is a reasonable behavior for core(single-part) GUC names, and for custom GUCs for which we have loadedan extension that's reserved the prefix. But it's unnecessarilyrestrictive otherwise, and it also causes inconsistent behavior:you can "ALTER SYSTEM SET foo.bar" only if you did "SET foo.bar"earlier in the session. That's fairly silly.Hence, refactor things so that we can execute ALTER SYSTEM evenif the variable doesn't have a GUC hashtable entry, as long as thename meets the custom-variable naming requirements and does nothave a reserved prefix. (It's safe to do this even if thevariable belongs to an extension we currently don't have loaded.A bad value will at worst cause a WARNING when the extensiondoes get loaded.)Also, adjust GRANT ON PARAMETER to have the same opinions aboutwhether to allow an unrecognized GUC name, and to throw thesame errors if not (it previously used a one-size-fits-allmessage for several distinguishable conditions). By default,only a superuser will be allowed to do ALTER SYSTEM SET on anunrecognized name, but it's possible to GRANT the ability todo it.Patch by me, pursuant to a documentation complaint fromGavin Panella. Arguably this is a bug fix, but given thelack of other complaints I'll refrain from back-patching.Discussion:https://postgr.es/m/2617358.1697501956@sss.pgh.pa.usDiscussion:https://postgr.es/m/169746329791.169914.16613647309012285391@wrigleys.postgresql.org1 parent36a14af commit2d870b4
File tree
5 files changed
+170
-96
lines changed- src
- backend
- catalog
- utils/misc
- include/utils
- test/modules/unsafe_tests
- expected
- sql
5 files changed
+170
-96
lines changedLines changed: 1 addition & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
82 | 82 |
| |
83 | 83 |
| |
84 | 84 |
| |
85 |
| - | |
86 |
| - | |
87 |
| - | |
88 |
| - | |
89 |
| - | |
| 85 | + | |
90 | 86 |
| |
91 | 87 |
| |
92 | 88 |
| |
|
Lines changed: 129 additions & 89 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
250 | 250 |
| |
251 | 251 |
| |
252 | 252 |
| |
| 253 | + | |
| 254 | + | |
253 | 255 |
| |
254 | 256 |
| |
255 | 257 |
| |
| |||
1063 | 1065 |
| |
1064 | 1066 |
| |
1065 | 1067 |
| |
1066 |
| - | |
| 1068 | + | |
1067 | 1069 |
| |
1068 | 1070 |
| |
1069 | 1071 |
| |
| |||
1098 | 1100 |
| |
1099 | 1101 |
| |
1100 | 1102 |
| |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
1101 | 1168 |
| |
1102 | 1169 |
| |
1103 | 1170 |
| |
| |||
1191 | 1258 |
| |
1192 | 1259 |
| |
1193 | 1260 |
| |
1194 |
| - | |
1195 |
| - | |
1196 |
| - | |
| 1261 | + | |
1197 | 1262 |
| |
1198 |
| - | |
1199 |
| - | |
1200 |
| - | |
1201 |
| - | |
1202 |
| - | |
1203 |
| - | |
1204 |
| - | |
1205 |
| - | |
1206 |
| - | |
1207 |
| - | |
1208 |
| - | |
1209 |
| - | |
1210 |
| - | |
1211 |
| - | |
1212 |
| - | |
1213 |
| - | |
1214 |
| - | |
1215 |
| - | |
1216 |
| - | |
1217 |
| - | |
1218 |
| - | |
1219 |
| - | |
1220 |
| - | |
1221 |
| - | |
1222 |
| - | |
1223 |
| - | |
1224 |
| - | |
1225 |
| - | |
1226 |
| - | |
1227 |
| - | |
1228 |
| - | |
1229 |
| - | |
1230 |
| - | |
1231 |
| - | |
1232 |
| - | |
1233 |
| - | |
1234 |
| - | |
| 1263 | + | |
1235 | 1264 |
| |
1236 |
| - | |
| 1265 | + | |
| 1266 | + | |
1237 | 1267 |
| |
1238 | 1268 |
| |
1239 |
| - | |
| 1269 | + | |
1240 | 1270 |
| |
1241 | 1271 |
| |
1242 | 1272 |
| |
| |||
1369 | 1399 |
| |
1370 | 1400 |
| |
1371 | 1401 |
| |
1372 |
| - | |
| 1402 | + | |
1373 | 1403 |
| |
1374 |
| - | |
| 1404 | + | |
1375 | 1405 |
| |
1376 | 1406 |
| |
1377 | 1407 |
| |
1378 |
| - | |
1379 |
| - | |
| 1408 | + | |
| 1409 | + | |
1380 | 1410 |
| |
1381 |
| - | |
1382 |
| - | |
1383 |
| - | |
| 1411 | + | |
1384 | 1412 |
| |
1385 | 1413 |
| |
1386 | 1414 |
| |
| |||
4515 | 4543 |
| |
4516 | 4544 |
| |
4517 | 4545 |
| |
4518 |
| - | |
4519 |
| - | |
4520 |
| - | |
4521 |
| - | |
4522 |
| - | |
4523 |
| - | |
4524 |
| - | |
4525 |
| - | |
4526 |
| - | |
4527 |
| - | |
4528 |
| - | |
4529 |
| - | |
4530 |
| - | |
4531 |
| - | |
4532 |
| - | |
4533 |
| - | |
4534 |
| - | |
4535 |
| - | |
4536 |
| - | |
| 4546 | + | |
| 4547 | + | |
| 4548 | + | |
4537 | 4549 |
| |
4538 |
| - | |
4539 |
| - | |
4540 |
| - | |
4541 |
| - | |
4542 |
| - | |
4543 |
| - | |
4544 |
| - | |
| 4550 | + | |
| 4551 | + | |
| 4552 | + | |
| 4553 | + | |
| 4554 | + | |
| 4555 | + | |
| 4556 | + | |
4545 | 4557 |
| |
4546 |
| - | |
4547 |
| - | |
4548 |
| - | |
| 4558 | + | |
| 4559 | + | |
| 4560 | + | |
| 4561 | + | |
| 4562 | + | |
| 4563 | + | |
| 4564 | + | |
| 4565 | + | |
| 4566 | + | |
| 4567 | + | |
| 4568 | + | |
4549 | 4569 |
| |
4550 |
| - | |
4551 |
| - | |
4552 |
| - | |
| 4570 | + | |
| 4571 | + | |
| 4572 | + | |
| 4573 | + | |
| 4574 | + | |
| 4575 | + | |
| 4576 | + | |
4553 | 4577 |
| |
| 4578 | + | |
| 4579 | + | |
| 4580 | + | |
| 4581 | + | |
| 4582 | + | |
| 4583 | + | |
| 4584 | + | |
4554 | 4585 |
| |
4555 |
| - | |
4556 |
| - | |
4557 |
| - | |
| 4586 | + | |
| 4587 | + | |
| 4588 | + | |
| 4589 | + | |
| 4590 | + | |
4558 | 4591 |
| |
4559 |
| - | |
4560 |
| - | |
4561 |
| - | |
4562 |
| - | |
| 4592 | + | |
4563 | 4593 |
| |
| 4594 | + | |
| 4595 | + | |
| 4596 | + | |
| 4597 | + | |
| 4598 | + | |
| 4599 | + | |
| 4600 | + | |
| 4601 | + | |
| 4602 | + | |
| 4603 | + | |
4564 | 4604 |
| |
4565 | 4605 |
| |
4566 | 4606 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
363 | 363 |
| |
364 | 364 |
| |
365 | 365 |
| |
366 |
| - | |
| 366 | + | |
367 | 367 |
| |
368 | 368 |
| |
369 | 369 |
| |
|
Lines changed: 25 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
220 | 220 |
| |
221 | 221 |
| |
222 | 222 |
| |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
223 | 245 |
| |
224 | 246 |
| |
225 |
| - | |
| 247 | + | |
226 | 248 |
| |
227 | 249 |
| |
228 | 250 |
| |
| |||
459 | 481 |
| |
460 | 482 |
| |
461 | 483 |
| |
| 484 | + | |
| 485 | + | |
462 | 486 |
| |
463 | 487 |
| |
464 | 488 |
| |
|
Lines changed: 14 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
98 | 98 |
| |
99 | 99 |
| |
100 | 100 |
| |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
101 | 114 |
| |
102 | 115 |
| |
103 | 116 |
| |
| |||
190 | 203 |
| |
191 | 204 |
| |
192 | 205 |
| |
| 206 | + | |
193 | 207 |
| |
194 | 208 |
| |
195 | 209 |
| |
|
0 commit comments
Comments
(0)