Re: Question about conccurrency control and Insert

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Stéphane Cazeaux <stephane(dot)cazeaux(at)netcentrex(dot)net>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Question about conccurrency control and Insert
Date: 2003-09-10 14:38:16
Message-ID: 20030910073142.I64012-100000@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 10 Sep 2003, [ISO-8859-1] Stphane Cazeaux wrote:

> So my question is : why the SELECT...FOR UPDATE of client 2, when
> unblocked, returns only one row, and a following SELECT in the same
> transaction returns two rows ? Is there a mechanisme I don't understand ?

From the docs:

Read Committed is the default isolation level in PostgreSQL. When a
transaction runs on this isolation level, a SELECT query sees only data
committed before the query began; it never sees either uncommitted data or
changes committed during query execution by concurrent transactions....
Notice that two successive SELECT commands can see different data, even
though they are within a single transaction, if other transactions commit
changes during execution of the first SELECT.
UPDATE, DELETE and SELECT FOR UPDATE commangs behave the same as SELECT in
terms of searching for target rows: they will only find target rows that
were committed as of the command start time.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-09-10 14:45:12 Re: Question about conccurrency control and Insert
Previous Message Alessandro GARDICH 2003-09-10 14:27:23 message type 0x50