Re: existing row not found by SELECT ... WHERE CTID = ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Matthias Apitz <guru(at)unixarea(dot)de>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: existing row not found by SELECT ... WHERE CTID = ?
Date: 2022-05-26 16:02:35
Message-ID: 2305902.1653580955@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> On Thursday, May 26, 2022, Matthias Apitz <guru(at)unixarea(dot)de> wrote:
>> Is there any way to get with the old CTID to the row, for example with
>> the old CTID to the new one which the row now has after the update of the
>> row?

> No, there is no link between old and new in the main table.

There is a forward link from the old CTID to the new, but we don't
provide any user-accessible way to use it. I wonder though if the
OP should be considering using SELECT FOR UPDATE in his cursor,
so that it'd automatically chain up to the newest row version.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Zheng Li 2022-05-26 22:19:21 Re: Support logical replication of DDLs
Previous Message David G. Johnston 2022-05-26 15:24:12 Re: existing row not found by SELECT ... WHERE CTID = ?