ROLLBACK(7)
π ROLLBACK(7) β the "nvm, undo it" command
okay bestie, so this is the ROLLBACK page from the PostgreSQL 17.11 Documentation β it's manual page ROLLBACK(7) and it's about the moment you realize your transaction was a mistake π«Ά
β¨ NAME β¨
ROLLBACK β abort the current transaction, aka the group-chat "unsend" of the SQL world π
π 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. like, all of them. gone. poof. it's giving "we're pretending that never happened" πβ¨
π¦ PARAMETERS π¦
WORK,TRANSACTIONβ optional key words. they have no effect whatsoever. pure decoration, no cap. πAND CHAINβ ifAND CHAINis specified, a new (not aborted) 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. so it's like "undo that, but immediately open a fresh one with the same settings" β main character energy π
π NOTES π
- Use
COMMITto successfully terminate a transaction. that's the "yes queen, keep it" button π - Issuing
ROLLBACKoutside of a transaction block emits a warning and otherwise has no effect. so it's just... shouting into the void π ROLLBACK AND CHAINoutside of a transaction block is an error. not a warning, an actual error. respect the boundaries fr fr
π₯ EXAMPLES π₯
to abort all changes:
ROLLBACK;
that's it. that's the whole example. iconic.
β COMPATIBILITY β
The command ROLLBACK conforms to the SQL standard. the form ROLLBACK TRANSACTION is a PostgreSQL extension. so ROLLBACK TRANSACTION is the homegrown upgrade, iykyk π§
π SEE ALSO π
BEGIN(7), COMMIT(7), ROLLBACK TO SAVEPOINT (ROLLBACK_TO_SAVEPOINT(7))
and that's the whole page, bestie π this one's from PostgreSQL 17.11, dated 2026, and it lives as manual page ROLLBACK(7) β go forth and undo your mistakes responsibly πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17 17.11-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