Re: [(known) BUG] DELETE/UPDATE more than one row in partitioned foreign table

From: Ajit Awekar <ajitpostgres(at)gmail(dot)com>
To: shihao zhong <zhong950419(at)gmail(dot)com>
Cc: Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>, Nikita Malakhov <hukutoc(at)gmail(dot)com>, Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Jehan-Guillaume de Rorthais <jgdr(at)dalibo(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [(known) BUG] DELETE/UPDATE more than one row in partitioned foreign table
Date: 2026-09-10 12:21:16
Message-ID: CAER375PRkMwNkPNHSKuEswY0gv6KWm0Fzz0GDDJXaDPBU-k2EQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Jakub,

Thanks for the detailed repros. Attached patch fixes #1, #3, and #4;
#2 as doc modification.

#1/#3: The whole-row Var and per-column Vars overlapped, duplicating
columns on the wire and misattributing conversion errors to the whole
row instead of the failing column. Fixed by skipping the whole-row Var
during deparse, fetching each column individually, and reconstructing
the row locally -- restores per-column error context and drops the
duplicate transfer.

#4: Fixed by filtering to Vars of the scanned relation. Also fixed a
zero-column-table assertion hit while testing this.

#2: Added a note on this as a known limitation to the
postgres_fdw "Remote Query Optimization" docs, recommending
whole-query shipping where possible and limiting affected row counts
otherwise.

Verified against your repros plus the full regression.

Thanks & Best Regards,
Ajit

On Mon, 7 Sept 2026 at 08:37, shihao zhong <zhong950419(at)gmail(dot)com> wrote:

> Hi Ajit, Nikita,
>
> A quick note as commitfest manager: this thread currently has two
> commitfest entries pointing at it, #6770 and #7211. Since Ajit's patch
> continues Nikita's work rather than competing with it, I have merged them
> into a single entry:
>
> https://commitfest.postgresql.org/patch/6770/
>
> Ajit, you are now listed as an author there alongside Nikita, and #7211 has
> been withdrawn as a duplicate. Nothing about your patch changed -- it is
> still the version under review, and cfbot tracks it as before. Please use
> #6770 from now on, and feel free to add reviewers or update the status
> there.
>
> Thanks,
> Shihao
>

Attachment Content-Type Size
v2-0001-postgres_fdw-Disambiguate-row-identity-by-remote-tableoid.patch application/octet-stream 104.0 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2026-09-10 12:22:02 Re: Review items for EXCEPT TABLE publication
Previous Message shveta malik 2026-09-10 12:06:58 Re: Crashes on a partition whose concurrent detach never finished