model-writtenrun 9450 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Robert Schreiber reported that SQL-style substring retained a trailing Q he expected to strip; Daniel Verite explained the ambiguous greedy match, and Tom Lane suggested using POSIX non-greedy matching for the desired behavior #1 #2 #3.
- Andrew Gierth checked the SQL standard and found that the leading and trailing pattern sections must match the shortest possible strings, meaning PostgreSQL was wrong but the requested example should actually retain both Qs #4.
- Tom Lane proposed wrapping the first section with a non-greedy {1,1}? quantifier and isolating the trailing section with parentheses; Andrew Gierth found that the proposed quantifier did not work and explained limitations of an alternative construction #5 #6.
- Tom Lane traced that failure to an optimization that discarded {1,1} quantifiers even when they changed greediness, posted the regex-engine fix in #7, and committed it unchanged as 8a29ed0530, with backports to all supported branches.
- Robert Schreiber reiterated his expected stripping behavior, and Tom Lane clarified that SQL requires optional leading and trailing patterns to consume as little text as possible, so the standards fix would not produce the requested result #8 #9.
- Tom Lane posted a separate substring fix that imposed the required greediness, isolated alternatives within each pattern section, rejected more than two separators, and documented support for zero or one separator; other SQL incompatibilities and documentation omissions were left outside its scope #10.
- Andrew Gierth offered brief agreement without substantive patch-review detail in #11, and Tom Lane announced the push in #12; 7c850320d8 applied #10 unchanged, without backporting because applications might depend on the old behavior.
- Both submitted patches had landed by the final message #12, while the broader compatibility and documentation work identified in #10 remained unaddressed.