Description
This command sets the transaction isolation level. The
SET TRANSACTION command sets the characteristics
for the current SQL-transaction. It has no effect on any subsequent
transactions. This command cannot be used after the first query or data-modification
statement (SELECT, INSERT,
DELETE, UPDATE,
FETCH, COPY) of a transaction
has been executed. SET SESSION CHARACTERISTICS
sets the default transaction isolation level for each transaction
for a session. SET TRANSACTION can override it
for an individual transaction.
The isolation level of a transaction determines what data the
transaction can see when other transactions are running concurrently.
- READ COMMITTED
A statement can only see rows committed before it began. This
is the default.
- SERIALIZABLE
The current transaction can only see rows committed before
first query or data-modification statement was executed in this transaction.
Tip: Intuitively, serializable means that two concurrent
transactions will leave the database in the same state as if
the two has been executed strictly after one another in either
order.
Notes
The session default transaction isolation level can also be set
with the command
SET default_transaction_isolation = 'value'
and in the
configuration file. Consult the Administrator's
Guide for more information.