Re: is_superuser versus set_config_option's parallelism check
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org, Robert Haas <robertmhaas@gmail.com>
Date: 2024-08-09T22:50:14Z
Lists: pgsql-hackers
Attachments
- v1-mark-is_superuser-as-settable-in-parallel.patch (text/x-diff) patch v1
I wrote: > Nathan Bossart <nathandbossart@gmail.com> writes: >> Another option might be to introduce a new GUC flag or source for anything >> we want to bypass the check (perhaps with the stipulation that it must also >> be marked PGC_INTERNAL). > A new GUC flag seems like a promising approach, and better than > giving a blanket exemption to PGC_INTERNAL. At least for > is_superuser, there's no visible value in restricting which > SetConfigOption calls can change it; they'd all need the escape > hatch. Here's a draft patch to fix it with a flag, now with regression tests. Also, now that the error depends on which parameter we're talking about, I thought it best to include the parameter name in the error and to re-word it to be more like all the other can't-set-this-now errors just below it. I'm half tempted to change the errcode and set_config_option return value to match the others too, ie ERRCODE_CANT_CHANGE_RUNTIME_PARAM and "return 0" not -1. I don't think the existing choices here are very well thought through, and they're certainly inconsistent with a lot of otherwise-similar-seeming refusals in set_config_option. regards, tom lane
Commits
-
Allow adjusting session_authorization and role in parallel workers.
- 364de74cff28 18.0 landed
- f3ab5d3a2d19 16.5 landed
- adf9808fa966 13.17 landed
- adc28d01e98b 12.21 landed
- 546a26b3d8df 14.14 landed
- 2f4e895be760 15.9 landed
- 2b8d33f66c13 17.0 landed
-
Fix failure to verify PGC_[SU_]BACKEND GUCs in pg_file_settings view.
- 059de3ca4766 17.0 cited