ROLLBACK_PREPARED(7pg14)

πŸ“¦ version 14.24, in opensuse-leap 16.0

πŸ’– 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_xacts system 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 🌟


πŸ’– 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