Add -S/--superuser option for witness database creation

Previously the witness database creation code was hard-coding the
username 'postgres' when accessing the previously initialised database.
However initdb was not passed any explicit username, meaning the
default database superuser name was the same as the user running
repmgr.

With this patch, a superuser user name (default: postgres) will
be passed to initdb.

Per report by eggyknap [1]

[1] https://github.com/2ndQuadrant/repmgr/issues/38

Conflicts:
	repmgr.c
	repmgr.h
This commit is contained in:
Ian Barwick
2014-12-22 16:01:58 +09:00
parent e39ec70ef0
commit 1d9aacfed9
2 changed files with 18 additions and 8 deletions

View File

@@ -56,6 +56,7 @@ typedef struct
char dest_dir[MAXFILENAME];
char config_file[MAXFILENAME];
char remote_user[MAXLEN];
char superuser[MAXLEN];
char wal_keep_segments[MAXLEN];
bool verbose;
bool force;
@@ -70,6 +71,6 @@ typedef struct
int keep_history;
} t_runtime_options;
#define T_RUNTIME_OPTIONS_INITIALIZER { "", "", "", "", "", "", DEFAULT_WAL_KEEP_SEGMENTS, false, false, false, false, false, "", "", 0 }
#define T_RUNTIME_OPTIONS_INITIALIZER { "", "", "", "", "", "", "", DEFAULT_WAL_KEEP_SEGMENTS, false, false, false, false, false, "", "", 0}
#endif