Re: [BUG] Query with postgres fwd deletes more tuples than it should

Поиск
Список
Период
Сортировка
От Etsuro Fujita
Тема Re: [BUG] Query with postgres fwd deletes more tuples than it should
Дата
Msg-id CAPmGK15YhzB1Xjs4-JmCe6rJjC_3LVZ9=JfYRPL8ow_JPx+CrQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [BUG] Query with postgres fwd deletes more tuples than it should  (jiaoshuntian@highgo.com)
Ответы Re: [BUG] Query with postgres fwd deletes more tuples than it should
Список pgsql-hackers
On Wed, Sep 17, 2025 at 2:46 PM <jiaoshuntian@highgo.com> wrote:
> I can reproduce the same issue using the script you provided.

This is a known bug.  See discussions in [1], where I proposed a
simple fix for it that disables foreign modifications in problematic
cases as shown by Daniil.

> I think a good way to fix would be to use `(tableoid, ctid)` together as the row
> identifier in row-by-row updates/deletes. This combination is unique
> across partitions and avoids the incorrect behavior, while still keeping
> LIMIT support.

Agreed; actually I created such a fix as well a long time ago, but
unfortunately it has many issues...

Best regards,
Etsuro Fujita

[1] https://www.postgresql.org/message-id/flat/20250718175314.4513c00a%40karst



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