Re: Confusions regards serializable transaction

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Hannah Huang <hannah(dot)huang(dot)y(at)gmail(dot)com>
Cc: pgsql-novice(at)lists(dot)postgresql(dot)org
Subject: Re: Confusions regards serializable transaction
Date: 2020-09-04 04:21:57
Message-ID: CAH2-WzkdNKZ+fZ9r+98ZbYR7iV4x7NJr6sh6og=R3xge5fUVvQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Thu, Sep 3, 2020 at 5:20 PM Hannah Huang <hannah(dot)huang(dot)y(at)gmail(dot)com> wrote:
> I’m confused about what will trigger the serializable error. My test environment is PG v12.
>
> This is how you can produce the test table:

Serializable isolation level promises to emulate serial transaction
execution for all committed transactions. I believe that your example
does not show behavior that breaks that specific promise.

I haven't thought about it much, but maybe the confusion here has
something to do with the fact that the transaction snapshot is not
acquired during the "begin isolation level serializable" statement.
It's actually acquired lazily, during the first
non-transaction-control statement in the transaction.

--
Peter Geoghegan

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Hannah Huang 2020-09-04 06:05:50 Re: Confusions regards serializable transaction
Previous Message Hannah Huang 2020-09-04 00:20:27 Confusions regards serializable transaction