ROLLBACK_PREPARED(7pg17)
π¦ NAME π¦
Okay bestie, welcome to ROLLBACK PREPARED(7) β aka the ROLLBACK_PREPARED(7pg17) page β the manual for ROLLBACK PREPARED. It cancels a transaction that was earlier prepared for two-phase commit. Periodt. π
β¨ SYNOPSIS β¨
ROLLBACK PREPARED transaction_id
πΈ DESCRIPTION πΈ
ROLLBACK PREPARED rolls back a transaction that is in prepared state. Thatβs the tea, no cap. π«Ά
π PARAMETERS π
transaction_idβ the transaction identifier of the transaction that is to be rolled back. Literally the name-tag for the prepared transaction youβre sending home. π
π₯ 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. Different session? Fine. Different user? Only if youβre a superuser. π
- This command cannot be executed inside a transaction block. Not me trying to nest this β itβs a no. π The prepared transaction is rolled back immediately.
- All currently available prepared transactions are listed in the
pg_prepared_xactssystem view. Thatβs your little guest list, iykyk. π
β οΈ Friendly lil warning: no transaction block for this one β it has main character energy and has to run on its own.
π EXAMPLES π
Roll back the transaction identified by the transaction identifier foobar:
ROLLBACK PREPARED 'foobar';
Slay. Thatβs the whole example. π
π 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 itβs giving βvery useful, but not standardized SQL-side,β fr fr. β¨
π SEE ALSO π
PREPARE TRANSACTION(PREPARE_TRANSACTION(7))COMMIT PREPARED(COMMIT_PREPARED(7))
Thatβs the whole page, bestie β brought to you by PostgreSQL 17.11, dated 2026. Iconic source/version energy, mwah ππ
π¦ where this page comes from
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17 17.11-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