ROLLBACK_PREPARED(7pg13)
π ROLLBACK PREPARED(7) β the prepared-transaction undo button π
okay so this is the ROLLBACK_PREPARED(7pg13) page, straight from the PostgreSQL 13.23 Documentation. she's giving official docs but make it group chat. π
β¨ NAME β¨
ROLLBACK_PREPARED β cancel a transaction that was earlier prepared for two-phase commit. no cap, that's the whole name vibe. π«Ά
π SYNOPSIS π
ROLLBACK PREPARED transaction_id
πΈ DESCRIPTION πΈ
okay so ROLLBACK PREPARED rolls back a transaction that is in prepared state. that's it. that's the assignment. π
π¦ PARAMETERS π¦
transaction_idβ the transaction identifier of the transaction that is to be rolled back. literally which prepared transaction you're rolling back. π³οΈ
π₯ NOTES π₯
- to roll back a prepared transaction, you must be either the same user that executed the transaction originally, or a superuser. but plot twist: you do not have to be in the same session that executed the transaction. bestie can be elsewhere. π«Ά
- this command cannot be executed inside a transaction block. nope. not allowed. the prepared transaction is rolled back immediately. no waiting around. β‘
- all currently available prepared transactions are listed in the
pg_prepared_xactssystem view. that's your little directory of prepared-transaction girlies. π
warning bestie: don't try to run this inside a transaction block β it's literally not allowed. π
π EXAMPLES π
roll back the transaction identified by the transaction identifier foobar:
ROLLBACK PREPARED 'foobar';
π COMPATIBILITY π
ROLLBACK PREPARED is a PostgreSQL extension. it's 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 girlies exist but the SQL part is not giving standardized. iykyk. π
π SEE ALSO π
PREPARE TRANSACTION(PREPARE_TRANSACTION(7))COMMIT PREPARED(COMMIT_PREPARED(7))
these are your besties for the two-phase commit saga. go read them. π
mwah π β this page is from PostgreSQL 13.23, dated 2025. periodt. π
π¦ where this page comes from
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13 13.23-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