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

Поиск
Список
Период
Сортировка
От Matthias Apitz
Тема Re: existing row not found by SELECT ... WHERE CTID = ?
Дата
Msg-id Yoz84iffDHkIIarP@pureos
обсуждение исходный текст
Ответ на Re: existing row not found by SELECT ... WHERE CTID = ?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
El día martes, mayo 24, 2022 a las 10:47:11 -0400, Tom Lane escribió:

> Matthias Apitz <guru@unixarea.de> writes:
> > We have a C-written program, written in ESQL/C, of our LMS where the logic
> > crawls with FETCH through a hit list and does UPDATE on some rows which
> > match certain condition. This works fine for thousands of rows every night,
> > but magically sometimes it fails.
> 
> Maybe something else already updated the row since the cursor was opened?
> That would change its CTID.

If you compare the time when the CTID was read:

[29858] [23.05.2022 23:21:21:842]: ecpg_get_data on line 2655: RESULT: (668486,20) offset:
19; array: no

with the time when it was not found:

[29858] [23.05.2022 23:21:21:844]: raising sqlcode 100 on line 2531: no data found on
line 2531

it's nearly imposible that our software could have done this. Maybe
VACUUM hits exactly this moment in time and row, but this sounds also like 5
good numbers in the lotery jackpot :-)

Thanks

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



В списке pgsql-general по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Can I start Update row in After Insert trigger function?
Следующее
От: Laurenz Albe
Дата:
Сообщение: Re: existing row not found by SELECT ... WHERE CTID = ?