Support writable foreign tables.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 21734d2fb896e0ecdddd3251caa72a3576e2d415
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2013-03-10T18:16:02Z
Releases: 9.3.0
Support writable foreign tables.

This patch adds the core-system infrastructure needed to support updates
on foreign tables, and extends contrib/postgres_fdw to allow updates
against remote Postgres servers.  There's still a great deal of room for
improvement in optimization of remote updates, but at least there's basic
functionality there now.

KaiGai Kohei, reviewed by Alexander Korotkov and Laurenz Albe, and rather
heavily revised by Tom Lane.

Files

PathChange+/−
contrib/file_fdw/input/file_fdw.source modified +0 −1
contrib/file_fdw/output/file_fdw.source modified +3 −7
contrib/postgres_fdw/connection.c modified +65 −2
contrib/postgres_fdw/deparse.c modified +239 −64
contrib/postgres_fdw/expected/postgres_fdw.out modified +1509 −0
contrib/postgres_fdw/postgres_fdw.c modified +931 −135
contrib/postgres_fdw/postgres_fdw.h modified +13 −5
contrib/postgres_fdw/sql/postgres_fdw.sql modified +74 −0
doc/src/sgml/ddl.sgml modified +18 −13
doc/src/sgml/fdwhandler.sgml modified +406 −33
doc/src/sgml/file-fdw.sgml modified +4 −3
doc/src/sgml/postgres-fdw.sgml modified +4 −1
doc/src/sgml/ref/create_foreign_data_wrapper.sgml modified +6 −4
src/backend/commands/copy.c modified +4 −11
src/backend/commands/explain.c modified +34 −1
src/backend/executor/execMain.c modified +37 −5
src/backend/executor/nodeForeignscan.c modified +2 −1
src/backend/executor/nodeModifyTable.c modified +133 −18
src/backend/nodes/copyfuncs.c modified +1 −0
src/backend/nodes/outfuncs.c modified +1 −0
src/backend/optimizer/plan/createplan.c modified +53 −1
src/backend/optimizer/plan/planner.c modified +13 −2
src/backend/optimizer/prep/preptlist.c modified +2 −1
src/backend/parser/analyze.c modified +2 −11
src/backend/rewrite/rewriteHandler.c modified +20 −7
src/include/foreign/fdwapi.h modified +60 −9
src/include/nodes/execnodes.h modified +6 −1
src/include/nodes/plannodes.h modified +29 −9
src/include/optimizer/planmain.h modified +2 −1