Re: existing row not found by SELECT ... WHERE CTID = ? - Mailing list pgsql-general

From Matthias Apitz
Subject Re: existing row not found by SELECT ... WHERE CTID = ?
Date
Msg-id YpZYbcZCkKvbXRuU@c720-r368166
Whole thread Raw
In response to Re: existing row not found by SELECT ... WHERE CTID = ?  (Matthias Apitz <guru@unixarea.de>)
List pgsql-general
Analizing our logs in more detail, we got to know that there are cases
where, after updating a row with something like:

     EXEC SQL UPDATE d01buch SET
                d01gsi =:d01gsi,
                d01ex  =:d01ex,
                ...
                d01vldate =:d01vldate
     WHERE CURRENT OF hc_d01buch;

we look-up the same row later again with its old CTID in :rowid; one solution
of it could be right after the UPDATE look-up the new CTID with:

     EXEC SQL SELECT ctid INTO :rowid FROM d01buch WHERE CURRENT OF hc_d01buch;

i.e. using the same CURSOR which was used for the UPDATE again for a
SELECT for the CTID. Can this work?

    matthias
-- 
Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub



pgsql-general by date:

Previous
From: Jeff Ross
Date:
Subject: Logically replicated table has no visible rows
Next
From: Tim Kelly
Date:
Subject: unoptimized nested loops