From: Etsuro Fujita <efujita@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: postgres_fdw: Account for triggers in non-direct remote UPDATE p
Date: Thu, 13 Jun 2019 09:15:59 +0000
Message-ID: <E1hbLpv-0006nr-ET@gemulon.postgresql.org> (raw)
postgres_fdw: Account for triggers in non-direct remote UPDATE planning.
Previously, in postgresPlanForeignModify, we planned an UPDATE operation
on a foreign table so that we transmit only columns that were explicitly
targets of the UPDATE, so as to avoid unnecessary data transmission, but
if there were BEFORE ROW UPDATE triggers on the foreign table, those
triggers might change values for non-target columns, in which case we
would miss sending changed values for those columns. Prevent optimizing
away transmitting all columns if there are BEFORE ROW UPDATE triggers on
the foreign table.
This is an oversight in commit 7cbe57c34 which added triggers on foreign
tables, so apply the patch all the way back to 9.4 where that came in.
Author: Shohei Mochizuki
Reviewed-by: Amit Langote
Discussion: https://postgr.es/m/201905270152.x4R1q3qi014550@toshiba.co.jp
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/8b6da83d162cb0ac9f6d21082727bbd45c972c53
Modified Files
--------------
contrib/postgres_fdw/expected/postgres_fdw.out | 33 ++++++++++++++++++++------
contrib/postgres_fdw/postgres_fdw.c | 19 ++++++++++-----
contrib/postgres_fdw/sql/postgres_fdw.sql | 5 ++++
3 files changed, 44 insertions(+), 13 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: efujita@postgresql.org
Subject: Re: pgsql: postgres_fdw: Account for triggers in non-direct remote UPDATE p
In-Reply-To: <E1hbLpv-0006nr-ET@gemulon.postgresql.org>
References: <E1hbLpv-0006nr-ET@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox