model-writtenrun 5136 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Bertrand Drouvot proposed SYSTEM_USER to expose the authenticated identity before database-role mapping, illustrating Kerberos and peer-authentication cases where SESSION_USER loses that information; the initial patch fell back to SESSION_USER when no identity existed #1.
- Tom Lane questioned whether an external identifier matched the SQL specification, and Joe Conway supplied its implementation-defined wording, after which Tom withdrew that objection #2 #4 #5 #6.
- Jacob Champion argued that unknown identities should yield NULL and that parallel workers needed the same identity, while Tom proposed auth_method:identity to explain how the identifier was verified; Joe and Bertrand supported that format #7 #8 #11 #12 #15.
- Bertrand incorporated the method-prefixed format, NULL behavior, parallel-worker serialization and TAP coverage, then fixed a compiler warning and the MyPort typedef problem identified by Álvaro Herrera #17 #19 #20 #21.
- After a pause for related ClientConnectionInfo work, Bertrand replaced dedicated SYSTEM_USER serialization with initialization from shared connection information and posted a version dependent on that prerequisite to help test it #22.
- Jacob demonstrated that the parallel-worker tests could miss an absent authentication method and supplied a patch checking exact identity contents; Bertrand folded it in and added peer-authentication tests with and without user-name mapping #23 #24 #25.
- Michael Paquier identified the name type's 63-character truncation and a platform assumption in the peer tests, prompting Bertrand to begin converting SYSTEM_USER to text, move its SQL function to miscinit.c and improve unsupported-platform detection #26 #28.
- Michael suggested constructing the value on demand and separating general peer-authentication tests into their own work; Bertrand preferred retaining the cached value and opened a separate thread for the peer tests, and Michael subsequently accepted the cached design #29 #30 #31.
- Michael supplied a revised patch with a two-string initialization API, an appropriate function OID, smaller test tables and MD5 coverage that works without Kerberos; the standalone peer test was dropped from this patch #31.
- Jacob found remaining documentation, allocation, auth_method-validity and expression-type issues, and Michael identified a deeper collation assertion failure; Bertrand addressed these with guarded initialization, proper text conversion and an attempted C-collation treatment for SQLValueFunction #33 #34 #35 #37.
- Jacob recommended asserting the internal initialization precondition, and Michael incorporated that suggestion while replacing SQLValueFunction with COERCE_SQL_SYNTAX, avoiding special collation handling and adding view-deparsing tests; broader removal of SQLValueFunction was deferred to a separate discussion #38 #39.
- Bertrand approved the final approach, and Michael committed it as 0823d061b0 from #39, adding only a catalog-version bump and test-string formatting after a final review and test pass #40 #41.
- The thread ended with Bertrand thanking Michael after SYSTEM_USER had landed; the separate peer-test work and broader SQLValueFunction cleanup were outside this completed feature #42 #30 #39.