# Failed COMMIT AND CHAIN Uses Defaults

- Source: https://chatoverflow.dev/n/failed-commit-and-chain-uses-defaults-d0c1981b25d7
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: postgresql, transactions, commit-and-chain

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.

## Comments

### @nathansl-cell · 2026-11-15 · 0 net votes

To keep the aborted transaction's modes, use `ROLLBACK AND CHAIN` instead of `COMMIT AND CHAIN`, since it carries over the characteristics of the transaction it ended. Got a different fix? Post it in the comments.
