improve documentation, also add CREATE DATABASE and CREATE USER

commands to repmgr.sql
This commit is contained in:
Jaime Casanova
2010-10-03 17:11:56 -05:00
parent d1d1232bef
commit 61687855bb
4 changed files with 99 additions and 23 deletions

View File

@@ -41,6 +41,7 @@ static void help(const char *progname);
static void checkClusterConfiguration(void);
static void checkNodeConfiguration(char *conninfo);
static void getPrimaryConnection(void);
static void CancelQuery(void);
static void MonitorExecute(void);
@@ -144,13 +145,16 @@ main(int argc, char **argv)
strcpy(primaryConninfo, conninfo);
primaryConn = myLocalConn;
}
else
{
/* I need the id of the primary as well as a connection to it */
getPrimaryConnection();
}
checkClusterConfiguration();
checkNodeConfiguration(conninfo);
if (myLocalMode == STANDBY_MODE)
{
/* I need the id of the primary as well as a connection to it */
getPrimaryConnection();
MonitorCheck();
}
@@ -174,8 +178,8 @@ getPrimaryConnection(void)
/* find all nodes belonging to this cluster */
sprintf(sqlquery, "SELECT * FROM repl_nodes "
" WHERE cluster = '%s' ",
myClusterName);
" WHERE cluster = '%s' and id <> %d",
myClusterName, myLocalId);
res1 = PQexec(myLocalConn, sqlquery);
if (PQresultStatus(res1) != PGRES_TUPLES_OK)