Does Postgresql support different transaction isolation per connection? I just discovered that H2 doesn't support concurrent connections using different transaction isolation levels. Meaning, changing the transaction isolation of one connection affects all other connections.

Does Postgresql support the use of different isolation levels for each connection?
Transaction isolation level is set up per transaction basis. Even one connection can have different isolation level on each transaction.

Of course different connection can have different isolation level.

Here's some testing :

postgres=# begin;
BEGIN
postgres=# show transaction_isolation ;
 transaction_isolation
-----------------------
 read committed
(1 row)

postgres=# set transaction isolation level serializable ;
SET
postgres=# show transaction_isolation ;
 transaction_isolation
-----------------------
 serializable
(1 row)


At the same time on another session :

postgres=# begin;
BEGIN
postgres=# show transaction_isolation
;
 transaction_isolation
-----------------------
 read committed
(1 row)

postgres=# set transaction isolation level read uncommitted ;
SET
postgres=# show transaction_isolation
;
 transaction_isolation
-----------------------
 read uncommitted
(1 row)


Once You commit a transaction and begin another new transaction, default isolation level will be used which set on postgresql.conf :

#default_transaction_isolation = 'read committed'


I try this on Postgres 9.1.

Hope this help, cheers.