•
|
A logical unit of work, or transaction, is a set of discrete operations that must be treated as a single operation to ensure database integrity. If you make a mistake or encounter a problem during a transaction, you can issue a ROLLBACK WORK statement to undo the changes you have already made.
|
•
|
A locking unit is the amount of data from which other tasks are blocked until your transaction is complete. (A task is a PSQL session.) Locking prevents other tasks from changing the data you are trying to change. If other tasks can also change the data, PSQL cannot roll back work to a previously consistent state. Thus, within a transaction, only one task may access a given locking unit at a time. However, multiple cursors that belong to the same task can access the locking unit at the same time.
|
•
|
Other tasks that are not in a transaction can read rows in the table, but they cannot update, delete, or insert rows.
|