COMMIT_PREPARED(7pg16)

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

πŸ’– COMMIT PREPARED πŸ’–

okay bestie, welcome to the COMMIT_PREPARED(7pg16) page β€” she’s giving β€œfinish what you started” energy and honestly? iconic. πŸŽ€


✨ NAME ✨

COMMIT_PREPARED β€” commit a transaction that was earlier prepared for two-phase commit. periodt. πŸ’…

🌸 SYNOPSIS 🌸

COMMIT PREPARED transaction_id

πŸ¦‹ DESCRIPTION πŸ¦‹

COMMIT PREPARED commits a transaction that is in prepared state. literally the final β€œyes bestie, lock it in” move. βœ…

πŸŽ€ PARAMETERS πŸŽ€

  • transaction_id β€” the transaction identifier of the transaction that is to be committed. no cap, that’s the one you’re sealing the deal on.

πŸ’– NOTES πŸ’–

  • To commit a prepared transaction, you must be either the same user that executed the transaction originally, or a superuser. But you do not have to be in the same session that executed the transaction. so like… authorized bestie privileges only, but not necessarily the same group chat. 🫢
  • This command cannot be executed inside a transaction block. the prepared transaction is committed immediately. absolutely no nesting, she said β€œone clean commit, no layers.” 😭
  • All currently available prepared transactions are listed in the pg_prepared_xacts system view. that’s your little guest list, iykyk. πŸ“‹

πŸ”₯ EXAMPLES πŸ”₯

Commit the transaction identified by the transaction identifier foobar:

COMMIT PREPARED 'foobar';

🌈 COMPATIBILITY 🌈

COMMIT PREPARED is a PostgreSQL extension. It is intended for use by external transaction management systems, some of which are covered by standards (such as X/Open XA), but the SQL side of those systems is not standardized. so she’s useful, she’s external-transaction-management-coded, and she’s not playing by one universal SQL rulebook. πŸ’€βœ¨

⭐ SEE ALSO ⭐


k bye bestie, this was PostgreSQL 16.15, dated 2026 β€” stay committed, but like… transactionally. πŸ‘‘πŸ’œ

πŸ“¦ where this page comes from