postgresql/src/backend
Robert Haas 37a3058bc7 Fix interaction of foreign tuple routing with remote triggers.
Without these fixes, changes to the inserted tuple made by remote
triggers are ignored when building local RETURNING tuples.

In the core code, call ExecInitRoutingInfo at a later point from
within ExecInitPartitionInfo so that the FDW callback gets invoked
after the returning list has been built.  But move CheckValidResultRel
out of ExecInitRoutingInfo so that it can happen at an earlier stage.

In postgres_fdw, refactor assorted deparsing functions to work with
the RTE rather than the PlannerInfo, which saves us having to
construct a fake PlannerInfo in cases where we don't have a real one.
Then, we can pass down a constructed RTE that yields the correct
deparse result when no real one exists.  Unfortunately, this
necessitates a hack that understands how the core code manages RT
indexes for update tuple routing, which is ugly, but we don't have a
better idea right now.

Original report, analysis, and patch by Etsuro Fujita.  Heavily
refactored by me.  Then worked over some more by Amit Langote.

Discussion: http://postgr.es/m/5AD4882B.10002@lab.ntt.co.jp
2018-05-01 13:21:46 -04:00
..
access In AtEOXact_Files, complain if any files remain unclosed at commit. 2018-04-28 17:45:02 -04:00
bootstrap Rationalize handling of array type names in bootstrap data. 2018-04-17 18:29:11 -04:00
catalog Write error messages about duplicate OIDs to stderr 2018-04-30 14:18:46 -04:00
commands Adjust hints and docs to suggest CREATE EXTENSION not CREATE LANGUAGE. 2018-04-27 13:42:03 -04:00
executor Fix interaction of foreign tuple routing with remote triggers. 2018-05-01 13:21:46 -04:00
foreign Remove bogus "extern" annotations on function definitions. 2018-02-19 12:07:44 -05:00
jit Post-feature-freeze pgindent run. 2018-04-26 14:47:16 -04:00
lib Post-feature-freeze pgindent run. 2018-04-26 14:47:16 -04:00
libpq Post-feature-freeze pgindent run. 2018-04-26 14:47:16 -04:00
main Update copyright for 2018 2018-01-02 23:30:12 -05:00
nodes Fix incorrect field type for PlannedStmt.jitFlags in outfuncs/readfuncs. 2018-04-28 16:46:24 -04:00
optimizer Post-feature-freeze pgindent run. 2018-04-26 14:47:16 -04:00
parser perltidy: Add option --nooutdent-long-quotes 2018-04-27 11:37:43 -04:00
partitioning Post-feature-freeze pgindent run. 2018-04-26 14:47:16 -04:00
po Translation updates 2017-08-07 13:55:34 -04:00
port Remove investigative code for can't-reattach-to-shared-memory errors. 2018-05-01 13:06:31 -04:00
postmaster In AtEOXact_Files, complain if any files remain unclosed at commit. 2018-04-28 17:45:02 -04:00
regex Update copyright for 2018 2018-01-02 23:30:12 -05:00
replication Don't do logical replication of TRUNCATE of zero tables 2018-04-30 13:49:20 -04:00
rewrite Simplify view-expansion code in rewriteHandler.c. 2018-04-14 21:01:03 -04:00
snowball Avoid unnecessary use of pg_strcasecmp for already-downcased identifiers. 2018-01-26 18:25:14 -05:00
statistics Fast ALTER TABLE ADD COLUMN with a non-NULL default 2018-03-28 10:43:52 +10:30
storage In AtEOXact_Files, complain if any files remain unclosed at commit. 2018-04-28 17:45:02 -04:00
tcop Post-feature-freeze pgindent run. 2018-04-26 14:47:16 -04:00
tsearch Post-feature-freeze pgindent run. 2018-04-26 14:47:16 -04:00
utils Remove "Generating" output from catalog scripts 2018-04-30 14:18:07 -04:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
Makefile Remove Windows module-list-dumping code. 2018-04-30 13:20:13 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
nls.mk Translation updates 2017-05-15 12:19:54 -04:00