From 68281e00540a29e7f9bfc154c25a78b875f560d1 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Tue, 6 Dec 2011 08:48:15 -0500 Subject: Make command-line tools smarter about finding a DB to connect to. If unable to connect to "postgres", try "template1". This allows things to work more smoothly in the case where the postgres database has been dropped. And just in case that's not good enough, also allow the user to specify a maintenance database to be used for the initial connection, to cover the case where neither postgres nor template1 is suitable. --- src/bin/scripts/dropuser.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/bin/scripts/dropuser.c') diff --git a/src/bin/scripts/dropuser.c b/src/bin/scripts/dropuser.c index bfd5b1cfd5a..f67fb0bcb8f 100644 --- a/src/bin/scripts/dropuser.c +++ b/src/bin/scripts/dropuser.c @@ -119,7 +119,8 @@ main(int argc, char *argv[]) appendPQExpBuffer(&sql, "DROP ROLE %s%s;\n", (if_exists ? "IF EXISTS " : ""), fmtId(dropuser)); - conn = connectDatabase("postgres", host, port, username, prompt_password, progname); + conn = connectDatabase("postgres", host, port, username, prompt_password, + progname, false); if (echo) printf("%s", sql.data); -- cgit v1.2.3