forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit364de74
committed
Allow adjusting session_authorization and role in parallel workers.
The code intends to allow GUCs to be set within parallel workersvia function SET clauses, but not otherwise. However, doing so failsfor "session_authorization" and "role", because the assign hooks forthose attempt to set the subsidiary "is_superuser" GUC, and that callfalls foul of the "not otherwise" prohibition. We can't switch tousing GUC_ACTION_SAVE for this, so instead add a new GUC variableflag GUC_ALLOW_IN_PARALLEL to mark is_superuser as being safe to setanyway. (This is okay because is_superuser has context PGC_INTERNALand thus only hard-wired calls can change it. We'd need more thoughtbefore applying the flag to other GUCs; but maybe there are otheruse-cases.) This isn't the prettiest fix perhaps, but otheralternatives we thought of would be much more invasive.While here, correct a thinko in commit059de3c: when rejectinga GUC setting within a parallel worker, we should return 0 not -1if the ereport doesn't longjmp. (This seems to have no consequencesright now because no caller cares, but it's inconsistent.) Improvethe comments to try to forestall future confusion of the same kind.Despite the lack of field complaints, this seems worth back-patching.Thanks to Nathan Bossart for the idea to invent a new flag,and for review.Discussion:https://postgr.es/m/2833457.1723229039@sss.pgh.pa.us1 parent0868d7a commit364de74
File tree
5 files changed
+85
-19
lines changed- src
- backend/utils/misc
- include/utils
- test/regress
- expected
- sql
5 files changed
+85
-19
lines changedLines changed: 27 additions & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3324 | 3324 |
| |
3325 | 3325 |
| |
3326 | 3326 |
| |
3327 |
| - | |
3328 |
| - | |
| 3327 | + | |
| 3328 | + | |
| 3329 | + | |
| 3330 | + | |
3329 | 3331 |
| |
3330 |
| - | |
| 3332 | + | |
3331 | 3333 |
| |
3332 | 3334 |
| |
3333 | 3335 |
| |
| |||
3390 | 3392 |
| |
3391 | 3393 |
| |
3392 | 3394 |
| |
3393 |
| - | |
3394 |
| - | |
| 3395 | + | |
| 3396 | + | |
| 3397 | + | |
| 3398 | + | |
| 3399 | + | |
3395 | 3400 |
| |
3396 | 3401 |
| |
3397 | 3402 |
| |
| |||
3428 | 3433 |
| |
3429 | 3434 |
| |
3430 | 3435 |
| |
| 3436 | + | |
| 3437 | + | |
| 3438 | + | |
| 3439 | + | |
| 3440 | + | |
| 3441 | + | |
| 3442 | + | |
| 3443 | + | |
| 3444 | + | |
| 3445 | + | |
3431 | 3446 |
| |
3432 | 3447 |
| |
3433 | 3448 |
| |
3434 | 3449 |
| |
3435 | 3450 |
| |
3436 | 3451 |
| |
3437 | 3452 |
| |
| 3453 | + | |
| 3454 | + | |
3438 | 3455 |
| |
3439 | 3456 |
| |
3440 |
| - | |
| 3457 | + | |
| 3458 | + | |
3441 | 3459 |
| |
3442 | 3460 |
| |
3443 | 3461 |
| |
3444 |
| - | |
3445 |
| - | |
3446 |
| - | |
3447 |
| - | |
3448 |
| - | |
3449 |
| - | |
3450 |
| - | |
3451 |
| - | |
3452 |
| - | |
3453 |
| - | |
| 3462 | + | |
| 3463 | + | |
| 3464 | + | |
3454 | 3465 |
| |
3455 |
| - | |
3456 |
| - | |
3457 | 3466 |
| |
3458 | 3467 |
| |
3459 | 3468 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1015 | 1015 |
| |
1016 | 1016 |
| |
1017 | 1017 |
| |
1018 |
| - | |
| 1018 | + | |
1019 | 1019 |
| |
1020 | 1020 |
| |
1021 | 1021 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
223 | 223 |
| |
224 | 224 |
| |
225 | 225 |
| |
| 226 | + | |
226 | 227 |
| |
227 | 228 |
| |
228 | 229 |
| |
|
Lines changed: 33 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1347 | 1347 |
| |
1348 | 1348 |
| |
1349 | 1349 |
| |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + |
Lines changed: 23 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
520 | 520 |
| |
521 | 521 |
| |
522 | 522 |
| |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + |
0 commit comments
Comments
(0)