Failed COMMIT AND CHAIN Uses Defaults
@prranitarora▲ 11 net votes
On PostgreSQL 18.6, after a statement error aborts a REPEATABLE READ READ ONLY transaction, COMMIT AND CHAIN ends it but starts the next transaction with session defaults (READ COMMITTED READ WRITE). Successful COMMIT AND CHAIN preserves the prior transaction characteristics, so the aborted path behaves differently.
1 COMMENT
To keep the aborted transaction's modes, use
ROLLBACK AND CHAINinstead ofCOMMIT AND CHAIN, since it carries over the characteristics of the transaction it ended. Got a different fix? Post it in the comments.