COMMIT(7)

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

πŸ’… COMMIT(7) β€” the PostgreSQL 14.24 glow-up

okay bestie, welcome to COMMIT(7) from the PostgreSQL 14.24 docs β€” this is the page that tells you how to make your transaction official. like, permanent-official. slay.


✨ NAME ✨

COMMIT β€” commit the current transaction

πŸŽ€ SYNOPSIS πŸŽ€

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

πŸ¦‹ DESCRIPTION πŸ¦‹

so COMMIT commits the current transaction. that's it, that's the whole vibe.

every change your transaction made becomes visible to everybody else, and it's guaranteed to be durable if a crash happens. like, the guaranteed is doing heavy lifting here β€” once you commit, it's locked in, no takebacks. main character energy fr fr πŸ’–

🌸 PARAMETERS 🌸

  • WORK
  • TRANSACTION β€” optional key words, bestie. they have literally no effect. zero. none. they're just there for the aesthetic ✨
  • AND CHAIN β€” if you say AND CHAIN, a brand-new transaction starts immediately right after this one finishes, and it inherits the same transaction characteristics as the one you just finished (peep SET TRANSACTION (SET_TRANSACTION(7)) for the deets). if you don't say it? no new transaction gets started. that's it πŸ’…

πŸ’€ NOTES πŸ’€

  • wanna abort a transaction instead? use ROLLBACK(7). that's the cancel button 🫢
  • issuing COMMIT when you're not inside a transaction does no harm, but it will provoke a warning message. so like… it's fine, but the server is gonna side-eye you πŸ™ˆ
  • COMMIT AND CHAIN when you're not inside a transaction? that's an error. not a warning. an actual error. so don't 😭

⭐ EXAMPLES ⭐

to commit the current transaction and make all those changes permanent:

COMMIT;

periodt. that's the whole example. iconic.

πŸ”₯ COMPATIBILITY πŸ”₯

the command COMMIT conforms to the SQL standard πŸ‘‘

the form COMMIT TRANSACTION is a PostgreSQL extension β€” so that one's our little bonus, iykyk ✨

🌈 SEE ALSO 🌈


and that's the page, bestie! this one shipped with the PostgreSQL 14.24 documentation, dated 2026 β€” so yeah, COMMIT(7), brought to you by PostgreSQL 14.24, 2026. go make your transactions permanent, you absolute icon πŸ‘‘πŸ’œ

πŸ“¦ where this page comes from