Parameterize record creation/update queries

Also merge the main functionality into a common function to avoid
duplication.
This commit is contained in:
Ian Barwick
2017-04-24 22:21:38 +09:00
parent ca6b493763
commit 8a04879953
3 changed files with 80 additions and 127 deletions

View File

@@ -544,6 +544,8 @@ do_master_register(void)
strncpy(node_info.slot_name, repmgr_slot_name_ptr, MAXLEN);
node_info.priority = config_file_options.priority;
// XXX if upstream_node_id set, warn that it will be ignored
if (record_found)
record_created = update_node_record(conn,
"master register",