Re: Strang behaviour SELECT ... LIMIT n FOR UPDATE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Daniel Caune" <daniel(dot)caune(at)ubisoft(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Strang behaviour SELECT ... LIMIT n FOR UPDATE
Date: 2007-11-28 22:08:24
Message-ID: 24728.1196287704@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Daniel Caune" <daniel(dot)caune(at)ubisoft(dot)com> writes:
> It seems that, in certain condition, row (199,84) is shadowing row
> (3702,85);

This would be the expected behavior if row (199,84) were an updated
version of row (3702,85), but you couldn't see it yet in your current
transaction snapshot. A plain SELECT would show the older version
(the current one according to the snapshot) while SELECT FOR UPDATE
would show the newest committed version.

I think you must have somehow got a corrupt-data situation with respect
to the commit status of these rows, but it's not real clear how.
Would you show us the xmin and xmax of the rows, and also the current
transaction counter? (pg_controldata will give you a close-enough
idea of the latter.)

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Alvaro Herrera 2007-11-29 01:08:18 Re: Strang behaviour SELECT ... LIMIT n FOR UPDATE
Previous Message Daniel Caune 2007-11-28 21:28:47 Re: Strang behaviour SELECT ... LIMIT n FOR UPDATE