RELEASE SAVEPOINT

Destroy a savepoint within the current transaction.

RELEASE [ SAVEPOINT ] name

When a savepoint is destroyed, the transaction cannot roll back to that point. This command also destroys all savepoints that were defined after the named savepoint was defined. For example, if you have created savepoints one, two, and three but you destroy savepoint two, savepoint three is also destroyed.

In the following example, when savepoint insert1 is released, insert2 is also destroyed, and the entire transaction is rolled back. No rows are inserted.
premdb=# begin;
BEGIN
premdb=# insert into season(seasonid) values(100);
INSERT 0 1
premdb=# savepoint insert1;
SAVEPOINT
premdb=# insert into season(seasonid) values(200);
INSERT 0 1
premdb=# savepoint insert2;
SAVEPOINT
premdb=# release savepoint insert1;
RELEASE
premdb=# rollback to insert2;
ERROR:  savepoint "insert2" does not exist
HINT:  named savepoint may have been destroyed with a RELEASE SAVEPOINT command
premdb=# rollback to insert1;
ERROR:  savepoint "insert1" does not exist
HINT:  named savepoint may have been destroyed with a RELEASE SAVEPOINT command
ROLLBACK
premdb=# select * from season where seasonid in(100,200);
ERROR:  current transaction is aborted, commands ignored until end of transaction block
premdb=# end;
ROLLBACK
premdb=# select * from season where seasonid in(100,200);
 seasonid | season_name | numteams | winners 
----------+-------------+----------+---------
(0 rows)