summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorRobert Haas2016-02-26 10:44:46 +0000
committerRobert Haas2016-02-26 10:44:46 +0000
commit35746bc348b6bf1f690fe17f4f80cfb68e22f504 (patch)
tree249efeced5372af345491e39d2c442f3ca610b6d /src/include
parent9117985b6ba9beda4f280f596035649fc23b6233 (diff)
Add new FDW API to test for parallel-safety.
This is basically a bug fix; the old code assumes that a ForeignScan is always parallel-safe, but for postgres_fdw, for example, this is definitely false. It should be true for file_fdw, though, since a worker can read a file from the filesystem just as well as any other backend process. Original patch by Thomas Munro. Documentation, and changes to the comments, by me.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/foreign/fdwapi.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/include/foreign/fdwapi.h b/src/include/foreign/fdwapi.h
index 9fafab06e95..ae3c230d667 100644
--- a/src/include/foreign/fdwapi.h
+++ b/src/include/foreign/fdwapi.h
@@ -131,6 +131,10 @@ typedef void (*InitializeDSMForeignScan_function) (ForeignScanState *node,
typedef void (*InitializeWorkerForeignScan_function) (ForeignScanState *node,
shm_toc *toc,
void *coordinate);
+typedef bool (*IsForeignScanParallelSafe_function) (PlannerInfo *root,
+ RelOptInfo *rel,
+ RangeTblEntry *rte);
+
/*
* FdwRoutine is the struct returned by a foreign-data wrapper's handler
* function. It provides pointers to the callback functions needed by the
@@ -188,6 +192,7 @@ typedef struct FdwRoutine
ImportForeignSchema_function ImportForeignSchema;
/* Support functions for parallelism under Gather node */
+ IsForeignScanParallelSafe_function IsForeignScanParallelSafe;
EstimateDSMForeignScan_function EstimateDSMForeignScan;
InitializeDSMForeignScan_function InitializeDSMForeignScan;
InitializeWorkerForeignScan_function InitializeWorkerForeignScan;