According to this, postgresql supports different isolation levels per connection and even different ones in the same connection. Let's say one connection is using serializable and another is using read-uncommitted. So what happens if both connections try to execute some transaction simultaneously? Does postgresql behave as if both connections were set to serializable?
asked Mar 10, 2019 at 16:50
-
3No, each transaction behaves according to its own isolation level in effect. Do you have reasons to believe it's not so?mustaccio– mustaccio2019年03月10日 17:14:03 +00:00Commented Mar 10, 2019 at 17:14
-
1@mustaccio, But wont it be possible for the serializable transaction to experience for example a phantom read because the read-uncommitted transaction wrote some data and then commited? And if the read-uncommitted transaction respects the locks acquired by the serializable transaction, wont it also be considered serializable anyway?kptlronyttcna– kptlronyttcna2019年03月10日 17:22:22 +00:00Commented Mar 10, 2019 at 17:22
-
1Postgres does not support read-uncommitteduser1822– user18222019年03月10日 17:22:29 +00:00Commented Mar 10, 2019 at 17:22
-
2If the read-uncommitted (which PostgreSQL treats the same as read-committed) writes some data and commits, then the serializable transaction will ignore that change. If it can't ignore change data (e.g. because it needs to update the same data that was changed) then it will fail with a serialization error.jjanes– jjanes2019年03月10日 19:15:01 +00:00Commented Mar 10, 2019 at 19:15
lang-sql