COMMIT_PREPARED(7pg13)
okay bestie, welcome to the COMMIT PREPARED page from the PostgreSQL 13.23 docs, manual COMMIT_PREPARED(7pg13). this is the final-boss move for a transaction thatβs already been prepared, and yes, itβs giving very much βclosing the loopβ energy π
β¨
π NAME π
COMMIT PREPARED β commit a transaction that was earlier prepared for two-phase commit. literally the βokay weβre actually doing thisβ button for a prepared transaction π«Ά
β¨ SYNOPSIS β¨
COMMIT PREPARED transaction_id
π¦ DESCRIPTION π¦
COMMIT PREPARED commits a transaction that is in prepared state. no cap, thatβs the whole vibe: prepared transaction goes in, committed transaction comes out π
πΈ PARAMETERS πΈ
transaction_idβ the transaction identifier of the transaction that is to be committed. yes bestie, you gotta name the exact transaction youβre committing π
π₯ 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 π
- this command cannot be executed inside a transaction block. nope, not allowed. the prepared transaction is committed immediately β‘
- all currently available prepared transactions are listed in the
pg_prepared_xactssystem view. thatβs your little guest list if you need to check whoβs still waiting π
β οΈ bestie, do not try to run this inside a transaction block. it is not that girl. the commit happens immediately.
π 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. iykyk π«
π SEE ALSO π
PREPARE TRANSACTION(PREPARE_TRANSACTION(7))ROLLBACK PREPARED(ROLLBACK_PREPARED(7))
and thatβs the whole page, bestie π brought to you by PostgreSQL 13.23, dated 2025, and the iconic little footer that is COMMIT PREPARED(7) πβ¨
π¦ 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