pgsql: postgres_fdw: Account for triggers in non-direct remote UPDATEp

Поиск
Список
Период
Сортировка
От Etsuro Fujita
Тема pgsql: postgres_fdw: Account for triggers in non-direct remote UPDATEp
Дата
Msg-id E1hbLpv-0006nt-EV@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2144601821618ddd007b4ce6b7f081a8ac6f65c9

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(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Doc: fix bogus example.
Следующее
От: Bruce Momjian
Дата:
Сообщение: pgsql: doc: PG 12 relnotes: update wording on truncate/vacuum item