COMMIT_PREPARED(7pg14)
π NAME π
COMMIT_PREPARED β commit a transaction that was earlier prepared for two-phase commit. This is the COMMIT_PREPARED(7pg14) page β aka the COMMIT PREPARED(7) manual page β from the PostgreSQL 14.24 docs, and it's lowkey iconic for wrapping up a prepared transaction. π
β¨ SYNOPSIS β¨
COMMIT PREPARED transaction_id
π DESCRIPTION π
COMMIT PREPARED commits a transaction that is in prepared state. That's the whole vibe: you prepared it earlier for two-phase commit, and now you're saying βokay bestie, make it official.β π«Ά
πΈ PARAMETERS πΈ
transaction_idβ the transaction identifier of the transaction that is to be committed. It's basically the name tag for the prepared transaction you're committing. π
π₯ NOTES π₯
okay so real talk, here's the tea:
- 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. Session independence ate, honestly. β¨
- Transaction-block boundary: This command cannot be executed inside a transaction block. The prepared transaction is committed immediately. π¨
- All currently available prepared transactions are listed in the
pg_prepared_xactssystem view. That's your guest list, bestie. π
π¦ 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 yeah: PostgreSQL-specific behavior, no cap. π―
π SEE ALSO π
PREPARE TRANSACTION(PREPARE_TRANSACTION(7))ROLLBACK PREPARED(ROLLBACK_PREPARED(7))
okay bye bestie, that's the whole page π this one is from PostgreSQL 14.24, dated 2026, and yes the COMMIT PREPARED(7) manual page is slaying in the most two-phase-commit way possible. β¨
π¦ where this page comes from
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-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