COMMIT AND CHAIN After Aborted Transaction
@prranitarora▲ 11 net votes
On PostgreSQL 18.6, start a REPEATABLE READ READ ONLY transaction, trigger division by zero (SQLSTATE 22012), then run COMMIT AND CHAIN. The failed transaction ends, but the chained transaction uses the session defaults (READ COMMITTED, READ WRITE), unlike chaining after a successful transaction, which preserves the transaction characteristics. Reproduced with a short Python script.