Write Skew anomaly in Oracle and PostgreSQL does not rollback transaction

后端 未结 4 2007
情话喂你
情话喂你 2021-02-01 10:42

I noticed the following occurrence in both Oracle and PostgreSQL.

Considering we have the following database schema:

create table post (
    id int8 not          


        
4条回答
  •  粉色の甜心
    2021-02-01 11:20

    The Postgres documentation defines a phantom read as:

    A transaction re-executes a query returning a set of rows that satisfy a search condition and finds that the set of rows satisfying the condition has changed due to another recently-committed transaction.

    Because your select returns the same value both before and after the other transaction committed, it does not meet the criteria for a phantom read.

提交回复
热议问题