diff options
| author | Robert Haas | 2016-03-18 17:48:58 +0000 |
|---|---|---|
| committer | Robert Haas | 2016-03-18 17:55:52 +0000 |
| commit | 0bf3ae88af330496517722e391e7c975e6bad219 (patch) | |
| tree | 46220c3ebfc9616af8d683c74395b18045c59a8a /src/include/nodes | |
| parent | 3422fecccadb021b7b4cdbc73b2c29f66f031761 (diff) | |
Directly modify foreign tables.
postgres_fdw can now sent an UPDATE or DELETE statement directly to
the foreign server in simple cases, rather than sending a SELECT FOR
UPDATE statement and then updating or deleting rows one-by-one.
Etsuro Fujita, reviewed by Rushabh Lathia, Shigeru Hanada, Kyotaro
Horiguchi, Albe Laurenz, Thom Brown, and me.
Diffstat (limited to 'src/include/nodes')
| -rw-r--r-- | src/include/nodes/execnodes.h | 2 | ||||
| -rw-r--r-- | src/include/nodes/pg_list.h | 3 | ||||
| -rw-r--r-- | src/include/nodes/plannodes.h | 2 |
3 files changed, 7 insertions, 0 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index d35ec810450..0113e5c663c 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -311,6 +311,7 @@ typedef struct JunkFilter * TrigInstrument optional runtime measurements for triggers * FdwRoutine FDW callback functions, if foreign table * FdwState available to save private state of FDW + * usesFdwDirectModify true when modifying foreign table directly * WithCheckOptions list of WithCheckOption's to be checked * WithCheckOptionExprs list of WithCheckOption expr states * ConstraintExprs array of constraint-checking expr states @@ -334,6 +335,7 @@ typedef struct ResultRelInfo Instrumentation *ri_TrigInstrument; struct FdwRoutine *ri_FdwRoutine; void *ri_FdwState; + bool ri_usesFdwDirectModify; List *ri_WithCheckOptions; List *ri_WithCheckOptionExprs; List **ri_ConstraintExprs; diff --git a/src/include/nodes/pg_list.h b/src/include/nodes/pg_list.h index 1cb95ee7385..77b50ff1c74 100644 --- a/src/include/nodes/pg_list.h +++ b/src/include/nodes/pg_list.h @@ -134,16 +134,19 @@ list_length(const List *l) #define list_make2(x1,x2) lcons(x1, list_make1(x2)) #define list_make3(x1,x2,x3) lcons(x1, list_make2(x2, x3)) #define list_make4(x1,x2,x3,x4) lcons(x1, list_make3(x2, x3, x4)) +#define list_make5(x1,x2,x3,x4,x5) lcons(x1, list_make4(x2, x3, x4, x5)) #define list_make1_int(x1) lcons_int(x1, NIL) #define list_make2_int(x1,x2) lcons_int(x1, list_make1_int(x2)) #define list_make3_int(x1,x2,x3) lcons_int(x1, list_make2_int(x2, x3)) #define list_make4_int(x1,x2,x3,x4) lcons_int(x1, list_make3_int(x2, x3, x4)) +#define list_make5_int(x1,x2,x3,x4,x5) lcons_int(x1, list_make4_int(x2, x3, x4, x5)) #define list_make1_oid(x1) lcons_oid(x1, NIL) #define list_make2_oid(x1,x2) lcons_oid(x1, list_make1_oid(x2)) #define list_make3_oid(x1,x2,x3) lcons_oid(x1, list_make2_oid(x2, x3)) #define list_make4_oid(x1,x2,x3,x4) lcons_oid(x1, list_make3_oid(x2, x3, x4)) +#define list_make5_oid(x1,x2,x3,x4,x5) lcons_oid(x1, list_make4_oid(x2, x3, x4, x5)) /* * foreach - diff --git a/src/include/nodes/plannodes.h b/src/include/nodes/plannodes.h index 5961f2c9884..00b1d35d759 100644 --- a/src/include/nodes/plannodes.h +++ b/src/include/nodes/plannodes.h @@ -189,6 +189,7 @@ typedef struct ModifyTable List *withCheckOptionLists; /* per-target-table WCO lists */ List *returningLists; /* per-target-table RETURNING tlists */ List *fdwPrivLists; /* per-target-table FDW private data lists */ + Bitmapset *fdwDirectModifyPlans; /* indices of FDW DM plans */ List *rowMarks; /* PlanRowMarks (non-locking only) */ int epqParam; /* ID of Param for EvalPlanQual re-eval */ OnConflictAction onConflictAction; /* ON CONFLICT action */ @@ -531,6 +532,7 @@ typedef struct WorkTableScan typedef struct ForeignScan { Scan scan; + CmdType operation; /* SELECT/INSERT/UPDATE/DELETE */ Oid fs_server; /* OID of foreign server */ List *fdw_exprs; /* expressions that FDW may evaluate */ List *fdw_private; /* private data for FDW */ |
