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-09T20:42:56Z
Lists: pgsql-hackers
Nathan Bossart <nathandbossart@gmail.com> writes: > On Fri, Aug 09, 2024 at 04:04:15PM -0400, Tom Lane wrote: >> Yeah, I had been thinking along the same lines. Here's a draft >> patch. (Still needs some attention to nearby comments, and I can't >> avoid the impression that the miscinit.c code in this area could >> use refactoring.) > Hm. That's a bit more code than I expected. Yeah. I can see a couple of points of attraction in this, but they're not strong: * Fewer cycles involved in setting session_authorization or role. But nobody has really complained that those are slow. * Gets us out from any other gotchas that may exist or be added in the SetConfigOption code path, not just this one point. This is mostly hypothetical, and a regression test case or two would likely catch any new problems anyway. > 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. 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