ABORT(7)
β¨ ABORT(7) β¨
okay so real talk β this is the ABORT page from the PostgreSQL 13.23 Documentation, section 7 (that's the "SQL commands" section bestie, iykyk). she's a classic, she's a little retro, and she's here to undo your oopsies. let's get into it π
π NAME π
ABORT β abort the current transaction. like, hit the big red undo button on whatever you just did. π¨
π¦ SYNOPSIS π¦
ABORT [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]
that's it. that's the whole vibe. look how short she is π
πΈ DESCRIPTION πΈ
okay so ABORT rolls back the current transaction and causes all the updates made by the transaction to be discarded. every single one. gone. poof. into the void π
and here's the tea: this command is identical in behavior to the standard SQL command ROLLBACK(7). literally the same thing. the only reason ABORT still exists is for historical reasons β she's an icon, she's a legacy queen, we keep her around out of respect π no cap.
π PARAMETERS π
WORK/TRANSACTIONβ optional key words. they have no effect. literally just decoration. cute jewelry, zero function π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. you just get the void. π«Ά
π NOTES π
- use
COMMIT(7)to successfully terminate a transaction. that's the "I meant to do that" option β¨ - issuing
ABORToutside of a transaction block emits a warning and otherwise has no effect. so likeβ¦ nothing happens, but the database will gently side-eye you π
fr fr: if you're not in a transaction, ABORT is just shouting into the void. it's giving main character energy with no plot π
π₯ EXAMPLES π₯
to abort all changes:
ABORT;
slay. obliterated. π
π COMPATIBILITY π
this command is a PostgreSQL extension present for historical reasons. ROLLBACK is the equivalent standard SQL command β so if you're hanging out with other databases, that's the one they'll recognize π¦
π SEE ALSO π
BEGIN(7), COMMIT(7), ROLLBACK(7)
okay ily, go forth and roll back responsibly π
this little moment was brought to you by PostgreSQL 13.23, dated 2025, and it's page ABORT(7) β catch you in the next one 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