On Thu, Sep 3, 2020 at 5:20 PM Hannah Huang <hannah.huang.y@gmail.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