ROLLBACK_PREPARED(7pg16)
π NAME π
Okay bestie, welcome to ROLLBACK PREPARED(7) from the PostgreSQL 16.15 Documentation β this is the page for ROLLBACK_PREPARED, and it's literally about how to cancel a transaction that was earlier prepared for two-phase commit. It's giving cleanup era, no cap. β¨
π«Ά SYNOPSIS π«Ά
ROLLBACK PREPARED transaction_id
πΈ DESCRIPTION πΈ
ROLLBACK PREPARED rolls back a transaction that is in prepared state. That's the whole job, and it ate. π
π PARAMETERS π
transaction_idβ the transaction identifier of the transaction that is to be rolled back. Like, the exact name tag of the transaction you're sending home.
π NOTES π
Real talk, bestie β here are the rules:
- 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. No cap.
- 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. That's your lineup view. π
π₯ 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 yeah β extension behavior, not standardized SQL on that side. Periodt. π¦
β SEE ALSO β
PREPARE TRANSACTION(PREPARE_TRANSACTION(7))COMMIT PREPARED(COMMIT_PREPARED(7))
xoxo, your prepared-transaction bestie π β this adorable page is from PostgreSQL 16.15 and dated 2026. periodt π
π¦ where this page comes from
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql16 16.15-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