COMMIT(7)

๐Ÿ’– COMMIT(7) ๐Ÿ’–

okay bestie, welcome to the COMMIT page โ€” it's the PostgreSQL 18.6 documentation moment, and we're gonna talk about the single most satisfying button in all of SQL. no cap. ๐Ÿซถ


โœจ NAME โœจ

COMMIT โ€” commit the current transaction ๐Ÿ’…


๐ŸŒธ SYNOPSIS ๐ŸŒธ

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

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

COMMIT commits the current transaction. Every change made by that transaction becomes visible to others, and it's guaranteed to be durable if a crash occurs. like... it's locked in. periodt. ๐Ÿ‘‘


๐ŸŽ€ PARAMETERS ๐ŸŽ€

  • WORK
  • TRANSACTION

optional key words, bestie. they have no effect. literally none. they're just there vibing. ๐Ÿซง

  • AND CHAIN

if AND CHAIN is specified, a new transaction is immediately started with the same transaction characteristics (see SET TRANSACTION (SET_TRANSACTION(7))) as the just finished one. otherwise, no new transaction is started. so it's giving "and another one" energy ๐Ÿ”ฅ


๐Ÿ’œ NOTES ๐Ÿ’œ

use ROLLBACK(7) to abort a transaction. that's the other button. choose wisely. ๐Ÿ˜ญ

issuing COMMIT when not inside a transaction does no harm, but it will provoke a warning message. so like, rude of you, but not fatal. COMMIT AND CHAIN when not inside a transaction, though? that's an error. not a vibe. ๐Ÿ’€


๐ŸŒˆ EXAMPLES ๐ŸŒˆ

to commit the current transaction and make all changes permanent:

COMMIT;

slay. that's it. that's the whole thing. โœจ


โญ COMPATIBILITY โญ

the command COMMIT conforms to the SQL standard. the form COMMIT TRANSACTION is a PostgreSQL extension. so we're standards-compliant and we have a lil bonus form. main character energy fr fr. ๐Ÿ‘‘


๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘

BEGIN(7), ROLLBACK(7)


and that's the whole page, bestie!! this was the PostgreSQL 18.6 docs, dated 2026, and the page is COMMIT(7) โ€” mwah, go commit something iconic ๐Ÿ’–โœจ๐ŸŽ€