January 2002
Intermediate to advanced
640 pages
16h 39m
English
Rolls back changes made during a transaction block.
ABORT [ WORK | TRANSACTION ]
WORK | TRANSACTIONA pair of optional noise keywords. They can be ignored, or used to make your SQL more readable.
ROLLBACKThe message returned when an ABORT completes successfully.
NOTICE: ROLLBACK: no transaction in progressThe notice returned if the database server is unable to find any transaction in progress.
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