ABORT(7)
π ABORT π
okay bestie, welcome to the ABORT(7) page β this is the PostgreSQL 18.6 docs, and we're gonna talk about the little command that says "nvm, undo all of it." π«Ά
β¨ NAME β¨
ABORT β abort the current transaction π₯
πΈ SYNOPSIS πΈ
ABORT [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]
π¦ DESCRIPTION π¦
So like. ABORT rolls back the current transaction, and it causes all the updates made by the transaction to be discarded. Poof. Gone. Never happened. π
And here's the tea: this command is identical in behavior to the standard SQL command ROLLBACK, and it's present only for historical reasons. That's it. That's the whole lore. It's giving legacy icon, not main character. π
π PARAMETERS π
WORK,TRANSACTIONβ optional key words. They literally have no effect. Decorative. Ornamental. No cap. πAND CHAINβ ifAND CHAINis specified, a new transaction is immediately started with the same transaction characteristics (seeSET TRANSACTION) as the just finished one. Otherwise, no new transaction is started. So it's like, you close one door and another one opens immediately with the same vibe. β¨
π NOTES π
Use COMMIT to successfully terminate a transaction. That's the "yesss we're keeping it" button. π
Issuing ABORT outside of a transaction block emits a warning and otherwise has no effect. So like, it just yells at you a little and then nothing happens. π
π EXAMPLES π
To abort all changes:
ABORT;
And that's it. That's the example. Clean, simple, iconic. β
π§ COMPATIBILITY π§
This command is a PostgreSQL extension present for historical reasons. ROLLBACK is the equivalent standard SQL command. So if you're out here trying to be standards-compliant, use ROLLBACK, bestie. π«Ά
π SEE ALSO π
BEGIN(7), COMMIT(7), ROLLBACK(7)
and that's the whole page, babe!! πΈ this was PostgreSQL 18.6, dated 2026 β ty for reading, now go undo something responsibly πβ¨π
π¦ where this page comes from
- opensuse-leap 16.0: postgresql18 18.6-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql18 18.6-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql18 18.6-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql18 18.6-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms