TXN 1 | TXN 2 |
---|---|
test=# begin; | test=# begin; |
BEGIN | BEGIN |
test=# SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; | test=# SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; |
SET | SET |
test=# update kv set v = 'b' where k = 'a'; | |
UPDATE 1 |
|test=# update kv set v = 'a' where k = 'a';
test=# select * from kv; | ... | test=# commit; | COMMIT | |ERROR: could not serialize access due to concurrent update |test=# select * from kv; |ERROR: current transaction is aborted, commands ignored until end of transaction block |test=# commit; |ROLLBACK