3

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
4
  • 3
    No, each transaction behaves according to its own isolation level in effect. Do you have reasons to believe it's not so? Commented 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? Commented Mar 10, 2019 at 17:22
  • 1
    Postgres does not support read-uncommitted Commented Mar 10, 2019 at 17:22
  • 2
    If 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. Commented Mar 10, 2019 at 19:15

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.