From d32a6cdb24624c49af850b2d3eba707815689bb9 Mon Sep 17 00:00:00 2001 From: Jaime Casanova Date: Fri, 15 Jun 2012 09:41:54 -0500 Subject: [PATCH] Remove kludge added to create user and db for witness. It's too fragile, almost always cause a "segment violation" and don't seems to be very useful. --- repmgr.c | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/repmgr.c b/repmgr.c index 6c1b9dd2..93f4025a 100644 --- a/repmgr.c +++ b/repmgr.c @@ -1629,37 +1629,6 @@ do_witness_create(void) exit(ERR_DB_QUERY); } - /* - create the local user and local db if it is not the default one - values[2] is the username we use to connect to master, - values[3] is the dbname we use to connect to master, - we suppose it is the same in the repmgr.conf (obviously it is preferable) - FIXME this is fragile and its a temporary solution - */ - if (getenv("USER")) - { - if (!(strcmp(getenv("USER"), values[2]) == 0)) - { - sprintf(createcommand, "createuser -p %s -s %s", runtime_options.localport, values[2]); - log_info("creating user for witness: %s", createcommand); - r = system(createcommand); - if (r != 0) - { - log_err("Can't create local user\n"); - PQfinish(masterconn); - exit(ERR_BAD_CONFIG); - } - sprintf(createcommand, "createdb -p %s -O %s %s", runtime_options.localport, values[2], values[3]); - log_info("creating database for witness: %s", createcommand); - r = system(createcommand); - if (r != 0) - { - log_err("Can't create local db\n"); - PQfinish(masterconn); - exit(ERR_BAD_CONFIG); - } - } - } /* establish a connection to the witness, and create the schema */ witnessconn = establishDBConnection(options.conninfo, true);