From c40489e449ea08e154cd62fa055785873f7bdac8 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Wed, 1 Aug 2018 17:39:07 -0400 Subject: Fix logical replication slot initialization This was broken in commit 9c7d06d60680, which inadvertently gave the wrong value to fast_forward in one StartupDecodingContext call. Fix by flipping the value. Add a test for the obvious error, namely trying to initialize a replication slot with an nonexistent output plugin. While at it, move the CreateDecodingContext call earlier, so that any errors are reported before sending the CopyBoth message. Author: Dave Cramer Reviewed-by: Andres Freund Discussion: https://postgr.es/m/CADK3HHLVkeRe1v4P02-5hj55H3_yJg3AEtpXyEY5T3wuzO2jSg@mail.gmail.com --- src/backend/replication/logical/logical.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/backend/replication/logical/logical.c') diff --git a/src/backend/replication/logical/logical.c b/src/backend/replication/logical/logical.c index 3cd4eefb9bf..bb83fc9d42d 100644 --- a/src/backend/replication/logical/logical.c +++ b/src/backend/replication/logical/logical.c @@ -312,7 +312,7 @@ CreateInitDecodingContext(char *plugin, ReplicationSlotSave(); ctx = StartupDecodingContext(NIL, InvalidXLogRecPtr, xmin_horizon, - need_full_snapshot, true, + need_full_snapshot, false, read_page, prepare_write, do_write, update_progress); -- cgit v1.2.3