Re: [(known) BUG] DELETE/UPDATE more than one row in partitioned foreign table - Mailing list pgsql-hackers

From Etsuro Fujita
Subject Re: [(known) BUG] DELETE/UPDATE more than one row in partitioned foreign table
Date
Msg-id CAPmGK16Kz3zau788CvvnuzZk72Gk4Udb9KnROUdmj2ajACeRKQ@mail.gmail.com
Whole thread Raw
In response to Re: [(known) BUG] DELETE/UPDATE more than one row in partitioned foreign table  (Etsuro Fujita <etsuro.fujita@gmail.com>)
List pgsql-hackers
On Wed, Jul 23, 2025 at 7:38 PM Etsuro Fujita <etsuro.fujita@gmail.com> wrote:
> I think a simple fix for this is to teach the system that the foreign
> table is a partitioned table; in more detail, I would like to propose
> to 1) add to postgres_fdw a table option, inherited, to indicate
> whether the foreign table is a partitioned/inherited table or not, and
> 2) modify postgresPlanForeignModify() to throw an error if the given
> operation is an update/delete on such a foreign table.  Attached is a
> WIP patch for that.  I think it is the user's responsibility to set
> the option properly, but we could modify postgresImportForeignSchema()
> to support that.  Also, I think this would be back-patchable.

I noticed that this issue occurs in other cases: eg, if a foreign
table is an updatable view on a partitioned/inherited table,
non-pushed-down updates/deletes on the foreign table have the same
issue.  So adding the support in postgresImportForeignSchema() is not
that simple.  I feel like leaving it to the user, at least for
back-branches.

Best regards,
Etsuro Fujita



pgsql-hackers by date:

Previous
From: Julien Rouhaud
Date:
Subject: Bogus bitmasking in heap2_desc
Next
From: Frédéric Yhuel
Date:
Subject: Re: vacuumdb changes for stats import/export