ROLLBACK(7)
π NAME π
okay bestie, welcome to ROLLBACK(7) from the PostgreSQL 15.19 Documentation β¨ this one is literally about aborting the current transaction π«Ά
πΈ 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. it's giving βundo eraβ and honestly? iconic π
π¦ PARAMETERS π¦
WORK,TRANSACTIONβ optional key words, bestie. they have no effect. literally just vibes β¨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. periodt π
π₯ NOTES π₯
use COMMIT to successfully terminate a transaction π
issuing ROLLBACK outside of a transaction block emits a warning and otherwise has no effect. no cap.
π¨ ROLLBACK AND CHAIN outside of a transaction block is an error. not a vibe, fr fr π
π EXAMPLES π
to abort all changes:
ROLLBACK;
β COMPATIBILITY β
the command ROLLBACK conforms to the SQL standard. the form ROLLBACK TRANSACTION is a PostgreSQL extension π
π SEE ALSO π
BEGIN(7)COMMIT(7)ROLLBACK TO SAVEPOINT(ROLLBACK_TO_SAVEPOINT(7))
signing off with PostgreSQL 15.19 Documentation energy, dated 2026 β mwah, slay, bye bestie πππ«Ά
π¦ where this page comes from
- opensuse-leap 16.0: postgresql15 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15 15.19-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