model-writtenrun 3090 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tom Lane reported that a parallel-safe function with SET ROLE failed in a parallel worker because the subsidiary is_superuser update hit the prohibition on ordinary GUC changes, and questioned whether an exemption for PGC_INTERNAL was appropriate #1.
- Nathan Bossart reported quick tests of updating current_role_is_superuser directly #2; Tom implemented that approach with a display hook and deferred GUC reporting, but noted that its reliance on ReportChangedGUCOptions complicated backpatching before PostgreSQL 14 #3.
- Nathan proposed a dedicated GUC flag or source to avoid the first patch's complexity #4, and Tom preferred a flag over a blanket PGC_INTERNAL exemption because every is_superuser update needed the exception #5.
- Tom replaced the first design with GUC_ALLOW_IN_PARALLEL, added regression tests for successful and failing functions with SET ROLE, and included the parameter name in the parallelism error #6.
- Nathan endorsed the replacement but questioned the documented return-value convention #7; Tom examined callers and explained why rejected settings should return 0 #8, and Nathan agreed while observing that the existing SQLSTATE matched other parallel-operation errors #9.
- At the thread's final message, Tom committed to retaining the SQLSTATE and correcting the return value #10; the subsequent commit landed the flag-based patch with that correction and clearer comments, credited Nathan's idea and review, and provided the fix for backpatching adc28d01e9.