aboutsummaryrefslogtreecommitdiff
path: root/contrib/postgres_fdw/postgres_fdw.h
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2018-02-07 15:34:30 -0500
committerRobert Haas <rhaas@postgresql.org>2018-02-07 15:34:30 -0500
commit1bc0100d270e5bcc980a0629b8726a32a497e788 (patch)
tree4c0dfc658b7c837705a55d105fed356a51bfc64d /contrib/postgres_fdw/postgres_fdw.h
parent7c44b75a2a0705bf17d0e7ef02b1a0a769306fa5 (diff)
downloadpostgresql-1bc0100d270e5bcc980a0629b8726a32a497e788.tar.gz
postgresql-1bc0100d270e5bcc980a0629b8726a32a497e788.zip
postgres_fdw: Push down UPDATE/DELETE joins to remote servers.
Commit 0bf3ae88af330496517722e391e7c975e6bad219 allowed direct foreign table modification; instead of fetching each row, updating it locally, and then pushing the modification back to the remote side, we would instead do all the work on the remote server via a single remote UPDATE or DELETE command. However, that commit only enabled this optimization when join tree consisted only of the target table. This change allows the same optimization when an UPDATE statement has a FROM clause or a DELETE statement has a USING clause. This works much like ordinary foreign join pushdown, in that the tables must be on the same remote server, relevant parts of the query must be pushdown-safe, and so forth. Etsuro Fujita, reviewed by Ashutosh Bapat, Rushabh Lathia, and me. Some formatting corrections by me. Discussion: http://postgr.es/m/5A57193A.2080003@lab.ntt.co.jp Discussion: http://postgr.es/m/b9cee735-62f8-6c07-7528-6364ce9347d0@lab.ntt.co.jp
Diffstat (limited to 'contrib/postgres_fdw/postgres_fdw.h')
-rw-r--r--contrib/postgres_fdw/postgres_fdw.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/contrib/postgres_fdw/postgres_fdw.h b/contrib/postgres_fdw/postgres_fdw.h
index 1ae809d2c6d..d37cc88b6ec 100644
--- a/contrib/postgres_fdw/postgres_fdw.h
+++ b/contrib/postgres_fdw/postgres_fdw.h
@@ -150,6 +150,7 @@ extern void deparseUpdateSql(StringInfo buf, PlannerInfo *root,
List **retrieved_attrs);
extern void deparseDirectUpdateSql(StringInfo buf, PlannerInfo *root,
Index rtindex, Relation rel,
+ RelOptInfo *foreignrel,
List *targetlist,
List *targetAttrs,
List *remote_conds,
@@ -162,6 +163,7 @@ extern void deparseDeleteSql(StringInfo buf, PlannerInfo *root,
List **retrieved_attrs);
extern void deparseDirectDeleteSql(StringInfo buf, PlannerInfo *root,
Index rtindex, Relation rel,
+ RelOptInfo *foreignrel,
List *remote_conds,
List **params_list,
List *returningList,