Re: Questions about update, delete, ctid...

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: "Florian G(dot) Pflug" <fgp(at)phlo(dot)org>
Cc: DANTE Alexandra <Alexandra(dot)Dante(at)bull(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: Questions about update, delete, ctid...
Date: 2006-07-30 15:04:10
Message-ID: 20060730150410.GB15467@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Jul 30, 2006 at 04:37:26PM +0200, Florian G. Pflug wrote:
> Martijn van Oosterhout wrote:
> >The word "become" is not really right. The old version has become
> >invisible to you and the new version is visible. Some other
> >transactions will see the old one, some the new one. However, there is
> >a link between the old and the new version do detect conflicting
> >updates.
>
> That sounds interesting... how is that link between old and new
> tuple implemented? I've been playing with the idea to implement
> "update table foo where current of <cursor>", and such a link
> would help tremendously. I read the code, but couldn't find any
> such link - which part of the code should I read closer?

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.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-07-30 15:27:33 Re: New variable server_version_num
Previous Message Florian G. Pflug 2006-07-30 14:37:26 Re: Questions about update, delete, ctid...