NAME SAVEPOINT - define a new savepoint within the current transaction SYNOPSIS SAVEPOINT savepoint_name DESCRIPTION ... SAVEPOINT establishes a new savepoint within the current tr…NAME RELEASE_SAVEPOINT - release a previously defined savepoint SYNOPSIS RELEASE [ SAVEPOINT ] savepoint_name DESCRIPTION RELEASE ... SAVEPOINT releases the named savepoint and all…NAME ROLLBACK_TO_SAVEPOINT - roll back to a savepoint SYNOPSIS ROLLBACK [ WORK | TRANSACTION ] TO [ SAVEPOINT ... savepoint_name DESCRIPTION Roll back all commands that were execut…also canceled by rolling back to a savepoint that is earlier than the command ... would be canceled by releasing an earlier savepoint, or by successful exit from a PL/pgSQLlock which is upgraded by a later savepoint. For example, this code: BEGIN; SELECT * FROM ... mytable WHERE key = 1 FOR UPDATE; SAVEPOINT s; UPDATE mytable SET ... WHERE key = 1; R…within a transaction block, use savepoints (see SAVEPOINT (7)). For reasons of backwards compatibility ... ROLLBACK (7), START TRANSACTION ( START_TRANSACTION (7)), SAVEPOINTALSO BEGIN (7), COMMIT (7), ROLLBACK TO SAVEPOINT ( ROLLBACK_TO_SAVEPOINTrollback mode works by issuing an implicit SAVEPOINT for you, just before each command that ... block, and then rolling back to the savepoint if the command fails. ON_ERROR_STOPALSO BEGIN (7), COMMIT (7), ROLLBACK (7), SAVEPOINT (7), SET TRANSACTION ( SET_TRANSACTIONentire transaction, use savepoints: BEGIN; -- other operations SAVEPOINT sp1; INSERT INTO wines VALUES('Chateau Lafite