From a5ead16d6f28e0087dcaef8bfa851b7e7f3d23e2 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Mon, 12 Jan 2015 12:24:27 +0900 Subject: [PATCH] Change query to use `COUNT(*)` No point implying we're fetching the entire record --- HISTORY | 6 ++++++ repmgrd.c | 5 ++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/HISTORY b/HISTORY index 6b476d2f..db1e32de 100644 --- a/HISTORY +++ b/HISTORY @@ -1,3 +1,9 @@ +3.0beta1 + Require PostgreSQL 9.3 or later (Ian) + Use `pg_basebackup` instead of `rsync` to clone standby servers (Ian) + Use `pg_ctl promote` to promote a standby to primary + Code consolidation and cleanup (Ian) + 2.0.1 2014-07-16 Documentation fixes and new QUICKSTART file (Ian) Explicitly specify directories to ignore when cloning (Ian) diff --git a/repmgrd.c b/repmgrd.c index 29482fa2..2cf2af6f 100644 --- a/repmgrd.c +++ b/repmgrd.c @@ -1275,14 +1275,13 @@ check_node_configuration(void) char sqlquery[QUERY_STR_LEN]; /* - * Check if we have my node information in repl_nodes + * Check if this node has an entry in `repl_nodes` */ log_info(_("%s Checking node %d in cluster '%s'\n"), progname, local_options.node, local_options.cluster_name); - // ZZZ change to COUNT(*) ??? sqlquery_snprintf(sqlquery, - "SELECT * " + "SELECT COUNT(*) " " FROM %s.repl_nodes " " WHERE id = %d " " AND cluster = '%s' ",