summaryrefslogtreecommitdiff
path: root/src/bin/scripts/dropuser.c
diff options
context:
space:
mode:
authorTom Lane2005-06-21 04:02:34 +0000
committerTom Lane2005-06-21 04:02:34 +0000
commit6f7fc0badef55b376f408bd318a8065fd2edf266 (patch)
treeb86da563c6c8de5c930f00e8f2a7d5a994ba2d18 /src/bin/scripts/dropuser.c
parentec3a1af0a89a169c100f7157f7c6932234ae5988 (diff)
Cause initdb to create a third standard database "postgres", which
unlike template0 and template1 does not have any special status in terms of backend functionality. However, all external utilities such as createuser and createdb now connect to "postgres" instead of template1, and the documentation is changed to encourage people to use "postgres" instead of template1 as a play area. This should fix some longstanding gotchas involving unexpected propagation of database objects by createdb (when you used template1 without understanding the implications), as well as ameliorating the problem that CREATE DATABASE is unhappy if anyone else is connected to template1. Patch by Dave Page, minor editing by Tom Lane. All per recent pghackers discussions.
Diffstat (limited to 'src/bin/scripts/dropuser.c')
-rw-r--r--src/bin/scripts/dropuser.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/scripts/dropuser.c b/src/bin/scripts/dropuser.c
index 343cae39b8d..32aa83557a6 100644
--- a/src/bin/scripts/dropuser.c
+++ b/src/bin/scripts/dropuser.c
@@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/bin/scripts/dropuser.c,v 1.13 2004/12/31 22:03:17 pgsql Exp $
+ * $PostgreSQL: pgsql/src/bin/scripts/dropuser.c,v 1.14 2005/06/21 04:02:33 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -116,7 +116,7 @@ main(int argc, char *argv[])
initPQExpBuffer(&sql);
appendPQExpBuffer(&sql, "DROP USER %s;\n", fmtId(dropuser));
- conn = connectDatabase("template1", host, port, username, password, progname);
+ conn = connectDatabase("postgres", host, port, username, password, progname);
if (echo)
printf("%s", sql.data);