Synopsis

Use the RELEASE SAVEPOINT statement to release the server-side state associated with tracking a savepoint and make the named savepoint no longer accessible to ROLLBACK TO.

Syntax

savepoint_release ::= RELEASE [ SAVEPOINT ] name

savepoint_release

RELEASESAVEPOINTname

Semantics

release

RELEASE [ SAVEPOINT ] name

NAME

The name of the savepoint you wish to release.

Other savepoints may be released

When you release a savepoint, all savepoints that were created after it was created are also released.

Examples

Begin a transaction and create a savepoint.

BEGIN TRANSACTION;
SAVEPOINT test;

Once you are done with it, release the savepoint:

RELEASE test;

If at this point, you attempt to rollback to test, it will be an error:

ROLLBACK TO test;
ERROR:  savepoint "test" does not exist

See also