COMMIT(7)

πŸ“¦ version 13.23, in opensuse-leap 16.0

✨ COMMIT(7) ✨

okay bestie, so you know how you're in the middle of a transaction and you're like... should I keep this or not? this is the "keep it" button πŸ’– it's giving main character energy for your data fr fr


🌸 NAME 🌸

COMMIT β€” commit the current transaction

like, actually save it, no take-backsies


πŸŽ€ SYNOPSIS πŸŽ€

COMMIT [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]

that's it. that's the whole vibe. one command, so much power πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

COMMIT commits the current transaction. literally what it says on the tin, bestie.

so here's the tea: all the changes you made in this transaction become visible to everyone else, and they're guaranteed to be durable if a crash occurs. like, even if the server just ✨perishes✨, your data is SAFE. that's the whole point. no cap. πŸ”₯


🌈 PARAMETERS 🌈

  • WORK optional keyword. does absolutely nothing. it's purely for the aesthetic. use it if it makes you feel fancy πŸŽ€
  • TRANSACTION also optional, also does nothing. same vibe. literally just there to look cute alongside WORK. pick your fighter, it doesn't matter πŸ’…
  • AND CHAIN okay so if you specify AND CHAIN, a brand new transaction starts immediately with the same transaction characteristics as the one you just finished. (peep SET TRANSACTION in SET_TRANSACTION(7) for the deets on those characteristics, iykyk)

if you don't say AND CHAIN? no new transaction. you're free. go touch grass. 🌱


⭐ NOTES ⭐

bestie listen up, this is important:

use ROLLBACK(7) to abort a transaction. different vibe entirely. that's the "nvm undo" button.

issuing COMMIT when you're not inside a transaction? does no harm, but it will provoke a warning message. like when you text someone and they leave you on read but with a little "hey are you okay?" notification. mildly embarrassing but survivable 😭

⚠️ but β€” COMMIT AND CHAIN when you're not inside a transaction is an actual ERROR. not a warning. a whole error. do not pass go. πŸ’€

πŸ“ EXAMPLES πŸ“

to commit the current transaction and make all your changes permanent (the moment of truth, the grand finale, the slay):

COMMIT;

that's it. that's the whole example. iconic. πŸ‘‘


πŸ’œ COMPATIBILITY πŸ’œ

the command COMMIT conforms to the SQL standard. ✨ we love a standards-compliant queen ✨

but heads up β€” the form COMMIT TRANSACTION is a PostgreSQL extension. so it's not standard SQL, it's just a lil PostgreSQL flex. you're welcome 🫢


🌸 SEE ALSO 🌸

(that's "start the transaction" and "never mind" β€” the whole trio, the holy trinity of transaction vibes 🧚)


and that's the page bestie!! from the PostgreSQL 13.23 docs, dated 2025, with love πŸ’– stay transactional, stay iconic ✨
πŸ“¦ where this page comes from