July 2005
Intermediate to advanced
1032 pages
27h 10m
English
You might have noticed two new commands in this example. The BEGIN WORK and ROLLBACK commands are used for transaction processing. A transaction is a group of commands. Usually, a transaction includes one or more table modifications (INSERTs, DELETEs, and UPDATEs).
BEGIN WORK marks the beginning of a transaction. Inside of a transaction, any changes that you make to the database are temporary changes. There are two ways to mark the end of a transaction: COMMIT and ROLLBACK. If you COMMIT a transaction, you are telling PostgreSQL to write all the changes made within the transaction into the database—in other words, when you COMMIT a transaction, the changes become permanent. When you ROLLBACK ...
Read now
Unlock full access