SLIDE 84 Experimenting with Concurrency in PostgreSQL
- The general structure of a transaction:
BEGIN TRANSACTION ; SET TRANSACTION ISOLATION LEVEL SERIALIZABLE ;
- - Other
- ptions ( instead
- f
SERIALIZABLE ) are:
READ , READ COMMITTED , READ UNCOMMITTED .
UNCOMMITTED is the same as READ COMMITTED .
versions < 9.1 , SERIALIZABLE is the same as REPEATABLE READ. <SQL CODE >
can be realized by sleeping ; the argument is in seconds .
are useful for studying the interaction
transactions . SELECT pg_sleep (10);
COMMIT directive ends the transaction . COMMIT TRANSACTION ;
- To study the interaction of several transactions, run each one in a
separate psql client window, on the same database.
- Use delays to enable human interaction and nontrivial concurrency.
- Some simple examples may be found on the course Web site.
Transaction Models and Concurrency Control 20130903 Slide 84 of 100