]> granicus.if.org Git - postgresql/commit
When WCOs are present, disable direct foreign table modification.
authorRobert Haas <rhaas@postgresql.org>
Mon, 24 Jul 2017 19:57:24 +0000 (15:57 -0400)
committerRobert Haas <rhaas@postgresql.org>
Mon, 24 Jul 2017 19:57:24 +0000 (15:57 -0400)
commit7086be6e3627c1ad797e32ebbdd232905b5f577f
treed126cf52681cbfd0812126681e9773ca4037a13a
parentb4af9e3f378ef56fa48b98a0bfb641900b0280dc
When WCOs are present, disable direct foreign table modification.

If the user modifies a view that has CHECK OPTIONs and this gets
translated into a modification to an underlying relation which happens
to be a foreign table, the check options should be enforced.  In the
normal code path, that was happening properly, but it was not working
properly for "direct" modification because the whole operation gets
pushed to the remote side in that case and we never have an option to
enforce the constraint against individual tuples.  Fix by disabling
direct modification when there is a need to enforce CHECK OPTIONs.

Etsuro Fujita, reviewed by Kyotaro Horiguchi and by me.

Discussion: http://postgr.es/m/f8a48f54-6f02-9c8a-5250-9791603171ee@lab.ntt.co.jp
contrib/postgres_fdw/expected/postgres_fdw.out
contrib/postgres_fdw/sql/postgres_fdw.sql
doc/src/sgml/postgres-fdw.sgml
src/backend/optimizer/plan/createplan.c