COMMIT v11
The COMMIT
command makes all database updates made during the current transaction permanent, and ends the current transaction.
The COMMIT
command may be used within anonymous blocks, stored procedures, or functions. Within an SPL program, it may appear in the executable section and/or the exception section.
In the following example, the third INSERT
command in the anonymous block results in an error. The effect of the first two INSERT
commands are 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
The edb_stmt_level_tx
configuration parameter shown in the example below can be set for the entire database using the ALTER DATABASE
command, or it can be set for the entire database server by changing it in the postgresql.conf
file.