ROLLBACK(7)
πΈ 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β ifAND CHAINis specified, a new transaction is immediately started with the same transaction characteristics (seeSET 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. π
IssuingROLLBACKoutside of a transaction block emits a warning and otherwise has no effect.ROLLBACK AND CHAINoutside 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
- 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