From 7ff7711919287a93f348023d77f9611633c9627c Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Tue, 10 May 2011 19:44:15 -0400 Subject: For create/dropdb, only connect once to the server since we now have a shared description table for pg_database comments. Also update comments about database name selection. --- src/bin/scripts/dropdb.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/bin/scripts/dropdb.c') diff --git a/src/bin/scripts/dropdb.c b/src/bin/scripts/dropdb.c index 1cf18fd5d89..48f73ae25e8 100644 --- a/src/bin/scripts/dropdb.c +++ b/src/bin/scripts/dropdb.c @@ -113,6 +113,11 @@ main(int argc, char *argv[]) appendPQExpBuffer(&sql, "DROP DATABASE %s;\n", fmtId(dbname)); + /* + * Connect to the 'postgres' database by default, except have + * the 'postgres' user use 'template1' so he can drop the + * 'postgres' database. + */ conn = connectDatabase(strcmp(dbname, "postgres") == 0 ? "template1" : "postgres", host, port, username, prompt_password, progname); -- cgit v1.2.3