ROLLBACK(7)

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

🌸 NAME 🌸

okay so bestie, this is ROLLBACK(7) β€” the manual page for ROLLBACK, aka abort the current transaction. It’s giving β€œundo button for the current transaction” energy, and honestly? Iconic. This is the ROLLBACK(7) page from PostgreSQL, so you already know it’s about undoing stuff and discarding updates. Periodt. πŸ’…

✨ SYNOPSIS ✨

ROLLBACK [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]

πŸ’– DESCRIPTION πŸ’–

ROLLBACK rolls back the current transaction and causes all the updates made by the transaction to be discarded. That’s the whole main-character move: everything the transaction did gets tossed. No cap. 🫢

πŸŽ€ PARAMETERS πŸŽ€

  • WORK β€” optional key word, bestie. It has no effect. Literally zero. πŸ’€
  • TRANSACTION β€” another optional key word. Also no effect. Same energy. ✨
  • AND CHAIN β€” if AND CHAIN is specified, a new transaction is immediately started with the same transaction characteristics (see SET TRANSACTION (SET_TRANSACTION(7))) as the just finished one. Otherwise, no new transaction is started.

πŸ¦‹ NOTES πŸ¦‹

Use COMMIT(7) to successfully terminate a transaction. That’s the β€œwe’re keeping this” girlie. πŸ’–

Issuing ROLLBACK outside of a transaction block emits a warning and otherwise has no effect. ROLLBACK AND CHAIN outside of a transaction block is an error. So like, don’t do the chain thing outside a transaction block β€” it’s not a vibe. 😭

🌈 EXAMPLES 🌈

To abort all changes:

ROLLBACK;

⭐ COMPATIBILITY ⭐

The command ROLLBACK conforms to the SQL standard. The form ROLLBACK TRANSACTION is a PostgreSQL extension. Slay. 🌟

πŸ‘‘ SEE ALSO πŸ‘‘

BEGIN(7), COMMIT(7), ROLLBACK TO SAVEPOINT (ROLLBACK_TO_SAVEPOINT(7))


PostgreSQL 13.23 Documentation Β· 2025 Β· ROLLBACK(7) β€” mwah, bestie πŸ’‹πŸ«Ά

πŸ“¦ where this page comes from