Contents
COMMIT
A command for committing the current transaction
COMMIT
is a transaction command for committing the current transaction.
COMMIT
has always been present in PostgreSQL.
Change history
- PostgreSQL 12
[ AND [ NO ] CHAIN ]
syntax added (commit 280a408b)
Examples
Basic execution of COMMIT
:
postgres=# BEGIN; BEGIN postgres=*# SELECT 1; ?column? ---------- 1 (1 row) postgres=*# COMMIT; COMMIT
Used with AND CHAIN
syntax (PostgreSQL 12 and later):
postgres=# BEGIN; BEGIN postgres=*# SELECT 1; ?column? ---------- 1 (1 row) postgres=*# COMMIT AND CHAIN; COMMIT postgres=*# SELECT 2; ?column? ---------- 2 (1 row)
postgres=*# COMMIT; COMMIT
References
- PostgreSQL documentation: COMMIT