Re: Questions about update, delete, ctid... - Mailing list pgsql-general

From Tom Lane
Subject Re: Questions about update, delete, ctid...
Date
Msg-id 26281.1154280264@sss.pgh.pa.us
Whole thread Raw
In response to Re: Questions about update, delete, ctid...  ("Florian G. Pflug" <fgp@phlo.org>)
Responses Re: Questions about update, delete, ctid...  ("Florian G. Pflug" <fgp@phlo.org>)
List pgsql-general
"Florian G. Pflug" <fgp@phlo.org> writes:
> Martijn van Oosterhout wrote:
>> It's the t_ctid field of the tuple header. But I don't see what that
>> has to do with "WHERE CURRENT OF". That expression should return the
>> tuple visible to your transaction, not some updated version which you
>> won't be able to fetch. If you end up updating the old version, the
>> system will take care of finding the newer version if necessary.

> The problem is that the ctid of the tuple that "fetch" returned
> might not actually be the tuple that needs to be updated.

Martijn's got a point though: it's not clear that that needs any special
care on the part of WHERE CURRENT OF.  It may be that the existing
EvalPlanQual machinery does everything that's needful.  Is the example
you show really any different from updating a tuple that someone else
updated while your UPDATE was in progress?  In both cases the EPQ
machinery will take care of chaining forward to the right version to
update.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Joining dates/times (was Re: Splitting Timestamps)
Next
From: David Hoksza
Date:
Subject: pg_statio_all_indexes