ABORT(7)
β¨ ABORT(7) β the "nvm bestie, undo" command β¨
okay so this is the glow-up of the ABORT(7) page β your group-chat cheat sheet for yeeting a transaction into the void π
no cap. the vibe is: undo the current transaction, discard all its updates, and move on with your life. periodt.
π NAME π
ABORT β abort the current transaction. that's it, that's the whole name section, bestie π
β¨ SYNOPSIS β¨
ABORT [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]
that's the whole incantation, copied exactly, no "fixing" the brackets π
π«Ά DESCRIPTION π«Ά
ABORT rolls back the current transaction and causes all the updates made by the transaction to be discarded. it's giving "ctrl+z but for a whole transaction" π
this command is identical in behavior to the standard SQL command ROLLBACK, and it's present only for historical reasons. so yeah, it's an icon for the lore, not because it's the freshest way to do it π
π PARAMETERS π
WORK,TRANSACTIONβ optional key words. they have no effect. literally just there, vibing π«Ά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.
no extra behaviour invented here, bestie β that's exactly what the page says π₯
πΈ NOTES πΈ
- use
COMMITto successfully terminate a transaction.ABORTis the "nvm" button,COMMITis the "ship it" button π - issuing
ABORToutside of a transaction block emits a warning and otherwise has no effect. so if you're not inside a transaction block, it's just gonna warn and do nothing β lowkey not useful, highkey not the moment π
π¦ EXAMPLES π¦
to abort all changes:
ABORT;
slay. that's the example. copy it exactly, semicolon and all β¨
π₯ COMPATIBILITY π₯
this command is a PostgreSQL extension present for historical reasons. ROLLBACK is the equivalent standard SQL command. iykyk π
π SEE ALSO π
go read those too, bestie β they're the rest of the transaction cinematic universe π¬β¨
π that's the whole page, signed, sealed, slayed: PostgreSQL 14.24 documentation, 2026, page ABORT(7) β mwah πβ¨π«Ά
π¦ where this page comes from
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-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