aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/replication/syncrep.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/backend/replication/syncrep.c b/src/backend/replication/syncrep.c
index ac29f567c3b..ce2009882d9 100644
--- a/src/backend/replication/syncrep.c
+++ b/src/backend/replication/syncrep.c
@@ -924,6 +924,13 @@ check_synchronous_standby_names(char **newval, void **extra, GucSource source)
return false;
}
+ if (syncrep_parse_result->num_sync <= 0)
+ {
+ GUC_check_errmsg("number of synchronous standbys (%d) must be greater than zero",
+ syncrep_parse_result->num_sync);
+ return false;
+ }
+
/* GUC extra value must be malloc'd, not palloc'd */
pconf = (SyncRepConfigData *)
malloc(syncrep_parse_result->config_size);