COMMIT v15
The COMMIT
command makes all database updates from the current transaction permanent and ends the current transaction.
You can use the COMMIT
command in anonymous blocks, stored procedures, or functions. In an SPL program, it can appear in the executable section and the exception section.
In this example, the third INSERT
command in the anonymous block results in an error. The effect of the first two INSERT
commands is retained as shown by the first SELECT
command. Even after issuing a ROLLBACK
command, the two rows remain in the table, as shown by the second SELECT
command verifying that they were indeed committed.
Note
You can set the edb_stmt_level_tx
configuration parameter shown in the example for the entire database using the ALTER DATABASE
command. Alternatively, you can set it for the entire database server by changing it in the postgresql.conf
file.