Name
ABORT
-- Rolls back changes made during a transaction block.
Synopsis
ABORT [ WORK | TRANSACTION ]
Parameters
ABORT accepts no parameters.
Results
- ROLLBACK
You will receive this message if the ABORT completes successfully.
- NOTICE: ROLLBACK: no transaction in progress
This message is displayed if the database server is unable to find any transaction in progress.
Description
The ABORT command rolls back the transaction currently in
progress and discards any updates it may have made to the database. The command
is used exactly the same as the SQL92 compliant command,
ROLLBACK, and is included only for compatibility reasons.
Remember to use the COMMIT to complete termination of a
transaction.
Examples
The following example demonstrates the use of ABORT to undo
an accidental delete.
booktown=# BEGIN WORK;
BEGIN
booktown=# DELETE FROM publishers WHERE id < 100;
DELETE 6
booktown=# ABORT WORK;
ROLLBACK