Thread

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

    Daniil Davydov <3danissimo@gmail.com> — 2025-09-17T13:10:52Z

    Hi,
    
    On Wed, Sep 17, 2025 at 6:46 PM Etsuro Fujita <etsuro.fujita@gmail.com> wrote:
    >
    > 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.
    >
    
    Thanks! Somehow I overlooked it.
    
    > > 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...
    
    I'll try to help with implementation of the proposed idea.
    
    BTW, maybe we should move commitfest entry [1] to the next CF?
    
    [1] https://commitfest.postgresql.org/patch/1819/
    --
    Best regards,
    Daniil Davydov