ROLLBACK_PREPARED(7pg14)
π bestie, meet ROLLBACK PREPARED(7) π
okay bestie, welcome to the ROLLBACK PREPARED manual page β the one where we cancel a transaction that was earlier prepared for two-phase commit. no cap, itβs giving βclean up that prepared transactionβ energy. π¦
β¨ NAME β¨
ROLLBACK_PREPARED β cancel a transaction that was earlier prepared for two-phase commit. π
πΈ SYNOPSIS πΈ
ROLLBACK PREPARED transaction_id
thatβs the whole synopsis, periodt. π
π DESCRIPTION π
okay so ROLLBACK PREPARED rolls back a transaction that is in prepared state. thatβs it. thatβs the job. itβs literally the cleanup crew for your prepared-transaction situation. π§
π PARAMETERS π
transaction_idβ the transaction identifier of the transaction that is to be rolled back. yes bestie, this is the βwhich one?β part. π«Ά
π₯ NOTES π₯
- to roll back a prepared transaction, you must be either the same user that executed the transaction originally, or a superuser. but you do not have to be in the same session that executed the transaction. π
- > π¨ transaction block? absolutely not. This command cannot be executed inside a transaction block. the prepared transaction is rolled back immediately. π
- All currently available prepared transactions are listed in the
pg_prepared_xactssystem view. go check it, iykyk. π
β EXAMPLES β
roll back the transaction identified by the transaction identifier foobar:
ROLLBACK PREPARED 'foobar';
π COMPATIBILITY π
ROLLBACK PREPARED is a PostgreSQL extension. it is intended for use by external transaction management systems, some of which are covered by standards (such as X/Open XA), but the SQL side of those systems is not standardized. so like, standards-adjacent but not standardized on the SQL side, bestie. π
π SEE ALSO π
PREPARE TRANSACTION(PREPARE_TRANSACTION(7)) β go read it next. πCOMMIT PREPARED(COMMIT_PREPARED(7)) β the other half of the prepared-transaction lore. β¨
π thatβs the page, bestie: sourced from PostgreSQL 14.24, dated 2026, and itβs literally the ROLLBACK PREPARED(7) manual page. periodt. π
π¦ where this page comes from
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms