ABORT

Name

ABORT -- Rolls back changes made during a transaction block.

Synopsis

ABORT [ WORK | TRANSACTION ]

Parameters

WORK | TRANSACTION

A pair of optional noise keywords. They can be ignored, or used to make your SQL more readable.

Results

ROLLBACK

The message returned when an ABORT completes successfully.

NOTICE: ROLLBACK: no transaction in progress

The notice returned if the database server is unable to find any transaction in progress.

Examples

The following example demonstrates the use of ABORT to undo an accidental DELETE command:

booktown=# BEGIN WORK;
BEGIN
booktown=# DELETE FROM publishers WHERE id < 100;
DELETE 6
booktown=# ABORT WORK;
ROLLBACK