Question about the isolation level and visible

From: 娄帅 <louis(dot)hust(dot)ml(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Question about the isolation level and visible
Date: 2015-06-26 01:11:43
Message-ID: CALJs9_3D+VNT6atvX5wK0OFmg4AgdMJXQLQN5ttK6qu6ZUknWg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi, all,

I start two session with the following execute time order:

session1: START TRANSACTION ISOLATION LEVEL SERIALIZABLE;

session2: INSERT INTO t1 values(1);
session2: COMMIT;

session1: SELECT * FROM t1;

I found session1 got the value 1 which is inserted by session2.

Is there any way to make session1 not see the value session2 inserted?

For mysql, I know there is a syntax:
START TRANSACTION WITH CONSISTENT SNAPSHOT.

I search the PG START syntax, but found none.

Any idea will be appreciated!

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2015-06-26 01:26:34 Re: BDR: Can a node live alone after being detached
Previous Message Dave Johansen 2015-06-26 00:59:06 Re: Inserting from multiple processes?