summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorPeter Eisentraut2017-03-23 12:36:36 +0000
committerPeter Eisentraut2017-03-23 12:55:37 +0000
commit7c4f52409a8c7d85ed169bbbc1f6092274d03920 (patch)
treefa3dc592bb2855e5cc0a200f4c408b4c8d299be5 /contrib
parent707576b571f05ec5b89adb65964d55f3ccccbd1b (diff)
Logical replication support for initial data copy
Add functionality for a new subscription to copy the initial data in the tables and then sync with the ongoing apply process. For the copying, add a new internal COPY option to have the COPY source data provided by a callback function. The initial data copy works on the subscriber by receiving COPY data from the publisher and then providing it locally into a COPY that writes to the destination table. A WAL receiver can now execute full SQL commands. This is used here to obtain information about tables and publications. Several new options were added to CREATE and ALTER SUBSCRIPTION to control whether and when initial table syncing happens. Change pg_dump option --no-create-subscription-slots to --no-subscription-connect and use the new CREATE SUBSCRIPTION ... NOCONNECT option for that. Author: Petr Jelinek <petr.jelinek@2ndquadrant.com> Tested-by: Erik Rijkers <er@xs4all.nl>
Diffstat (limited to 'contrib')
-rw-r--r--contrib/file_fdw/file_fdw.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/file_fdw/file_fdw.c b/contrib/file_fdw/file_fdw.c
index 735b79484c..277639f6e9 100644
--- a/contrib/file_fdw/file_fdw.c
+++ b/contrib/file_fdw/file_fdw.c
@@ -662,6 +662,7 @@ fileBeginForeignScan(ForeignScanState *node, int eflags)
node->ss.ss_currentRelation,
filename,
is_program,
+ NULL,
NIL,
options);
@@ -737,6 +738,7 @@ fileReScanForeignScan(ForeignScanState *node)
node->ss.ss_currentRelation,
festate->filename,
festate->is_program,
+ NULL,
NIL,
festate->options);
}
@@ -1100,7 +1102,8 @@ file_acquire_sample_rows(Relation onerel, int elevel,
/*
* Create CopyState from FDW options.
*/
- cstate = BeginCopyFrom(NULL, onerel, filename, is_program, NIL, options);
+ cstate = BeginCopyFrom(NULL, onerel, filename, is_program, NULL, NIL,
+ options);
/*
* Use per-tuple memory context to prevent leak of memory used to read