model-writtenrun 5805 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Greg Rychlewski reported that a logical replication connection rejected two SQL statements in one query string even though a single statement succeeded #1.
- Tom Lane traced the failure to make_sqlcmd() stopping at a semicolon, then demonstrated additional failures with dollar-quoted strings, leading comments, and lexer state surviving errors; he proposed stopping replication scanning as soon as ordinary SQL was recognized #2.
- Tom Lane separately fixed the persistent lexer state by adding BEGIN(INITIAL) in 3c06ec6d14, which he reported as already pushed in #3.
- The attached patch checks only the first token, pushes replication-command keywords back for parsing, and otherwise delegates to normal SQL processing; Tom Lane kept classification inside repl_scanner.l because its keyword tokens were not exported, removed SQLCmd, and aligned whitespace handling with the core lexer #3.
- At the last message, the main patch was proposed with SQLCmd removal excluded from stable branches to preserve NodeTag numbering #3; it subsequently landed unchanged as 6aa5186146, and both fixes were backported to all supported branches.