1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-30 21:42:05 +03:00

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.
This commit is contained in:
Bruce Momjian
2011-05-10 19:44:15 -04:00
parent 87631ac98d
commit 7ff7711919
2 changed files with 12 additions and 4 deletions

View File

@ -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);