Re: BUG #16631: postgres_fdw tries to insert into generated columns

Etsuro Fujita <etsuro.fujita@gmail.com>

From: Etsuro Fujita <etsuro.fujita@gmail.com>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, dacherny@gmail.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2021-08-04T08:30:44Z
Lists: pgsql-bugs

Attachments

On Thu, Jul 15, 2021 at 6:15 PM Etsuro Fujita <etsuro.fujita@gmail.com> wrote:
> On Tue, Jul 13, 2021 at 5:36 AM Peter Eisentraut
> <peter.eisentraut@enterprisedb.com> wrote:

> > The follow-up proposal was to let the FDW implementation decide.  I
> > don't think that is always the right thing either.  What if I want the
> > foreign-table node to do the computations, because it has access to
> > special parameters or something.
>
> The follow-up proposal was mainly for consistency with the handling of
> constraints on foreign tables; they are not enforced on the local PG
> server at all, as noted in the above documentation.
>
> > There might be multiple possibilities of what is appropriate here.  But
> > that's not something we can just change around as part of a bug fix.
>
> I agree on this part.  The changes I made to the core side would go
> beyond a fix for the reported issue.  I'll remove it in the next
> version of the patch.

I updated the patch as such.  Attached is an update patch
(postgres_fdw-generated-columns-PG14-HEAD.patch), which would apply to
HEAD and v14.  I'm also attaching a patch for v12 and v13
(postgres_fdw-generated-columns-PG12-PG13.patch).  I'll apply these if
there are no objections.

Best regards,
Etsuro Fujita

Commits

  1. postgres_fdw: Fix issues with generated columns in foreign tables.