Improve connectMaintenanceDatabase() error reporting.

The prior coding instructs the user to pick an alternative maintenance
database, but this is overly clever, since it obscures whatever the real
cause of the failure is.

Josh Kupershmidt
This commit is contained in:
Robert Haas 2012-03-21 10:56:26 -04:00
parent aefa6d163e
commit 99081c63e4

View File

@ -197,17 +197,7 @@ connectMaintenanceDatabase(const char *maintenance_db, const char *pghost,
progname, true);
if (!conn)
conn = connectDatabase("template1", pghost, pgport, pguser,
prompt_password, progname, true);
if (!conn)
{
fprintf(stderr, _("%s: could not connect to databases \"postgres\" or \"template1\"\n"
"Please specify an alternative maintenance database.\n"),
progname);
fprintf(stderr, _("Try \"%s --help\" for more information.\n"),
progname);
exit(1);
}
prompt_password, progname, false);
return conn;
}