Commits the current transaction.

Syntax

COMMIT [ WORK ]

Description

You can use the Commit command to commit the current transaction. All changes that are made by the transaction are visible to others and retained even if an exception occurs.

Note You can use the ROLLBACK command to abort the transaction. Issuing the COMMIT command outside the transaction does not cause damage.

When you run the COMMIT command in a PL/pgSQL procedure, an error occurs if an Oracle-style SPL stored procedure exists on the runtime stack.

Parameters

Parameter Description
WORK Optional. This keyword has no effect.

Example

Commit the current transaction and permanently store the changes:

COMMIT;