diff --git a/repmgr-client.c b/repmgr-client.c index 9dca006f..0f44836a 100644 --- a/repmgr-client.c +++ b/repmgr-client.c @@ -90,6 +90,10 @@ main(int argc, char **argv) * * Only some actions will need these, but we need to do this before * the command line is parsed. + * + * Note: PQconndefaults() does not provide a default value for + * "dbname", but if none is provided will default to "username" + * when the connection is made. */ initialize_conninfo_params(&source_conninfo, true); @@ -123,15 +127,6 @@ main(int argc, char **argv) } } - /* - * Though libpq will default to the username as dbname, PQconndefaults() - * doesn't return this - */ - if (runtime_options.dbname[0] == '\0') - { - strncpy(runtime_options.dbname, runtime_options.username, MAXLEN); - } - /* set default user for -R/--remote-user */ {