diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-06-21 04:02:34 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-06-21 04:02:34 +0000 |
| commit | 6f7fc0badef55b376f408bd318a8065fd2edf266 (patch) | |
| tree | b86da563c6c8de5c930f00e8f2a7d5a994ba2d18 /src/test | |
| parent | ec3a1af0a89a169c100f7157f7c6932234ae5988 (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/test')
| -rwxr-xr-x | src/test/bench/create.sh | 6 | ||||
| -rw-r--r-- | src/test/examples/testlibpq.c | 4 | ||||
| -rw-r--r-- | src/test/examples/testlibpq2.c | 4 | ||||
| -rw-r--r-- | src/test/examples/testlibpq3.c | 4 | ||||
| -rw-r--r-- | src/test/regress/pg_regress.sh | 4 |
5 files changed, 11 insertions, 11 deletions
diff --git a/src/test/bench/create.sh b/src/test/bench/create.sh index 77c08368303..a865e68f8fa 100755 --- a/src/test/bench/create.sh +++ b/src/test/bench/create.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $PostgreSQL: pgsql/src/test/bench/create.sh,v 1.4 2004/09/01 17:25:40 tgl Exp $ +# $PostgreSQL: pgsql/src/test/bench/create.sh,v 1.5 2005/06/21 04:02:34 tgl Exp $ # if [ ! -d $1 ]; then echo " you must specify a valid data directory " >&2 @@ -10,10 +10,10 @@ if [ -d ./obj ]; then fi echo =============== destroying old bench database... ================= -echo "drop database bench" | postgres -D${1} template1 > /dev/null +echo "drop database bench" | postgres -D${1} postgres > /dev/null echo =============== creating new bench database... ================= -echo "create database bench" | postgres -D${1} template1 > /dev/null +echo "create database bench" | postgres -D${1} postgres > /dev/null if [ $? -ne 0 ]; then echo createdb failed exit 1 diff --git a/src/test/examples/testlibpq.c b/src/test/examples/testlibpq.c index b9d396a2dcb..3295076481e 100644 --- a/src/test/examples/testlibpq.c +++ b/src/test/examples/testlibpq.c @@ -26,14 +26,14 @@ main(int argc, char **argv) /* * If the user supplies a parameter on the command line, use it as the - * conninfo string; otherwise default to setting dbname=template1 and + * conninfo string; otherwise default to setting dbname=postgres and * using environment variables or defaults for all other connection * parameters. */ if (argc > 1) conninfo = argv[1]; else - conninfo = "dbname = template1"; + conninfo = "dbname = postgres"; /* Make a connection to the database */ conn = PQconnectdb(conninfo); diff --git a/src/test/examples/testlibpq2.c b/src/test/examples/testlibpq2.c index 1cb7616f24b..9f1e96d8dac 100644 --- a/src/test/examples/testlibpq2.c +++ b/src/test/examples/testlibpq2.c @@ -46,14 +46,14 @@ main(int argc, char **argv) /* * If the user supplies a parameter on the command line, use it as the - * conninfo string; otherwise default to setting dbname=template1 and + * conninfo string; otherwise default to setting dbname=postgres and * using environment variables or defaults for all other connection * parameters. */ if (argc > 1) conninfo = argv[1]; else - conninfo = "dbname = template1"; + conninfo = "dbname = postgres"; /* Make a connection to the database */ conn = PQconnectdb(conninfo); diff --git a/src/test/examples/testlibpq3.c b/src/test/examples/testlibpq3.c index 7036d3e81fb..49b03066cd8 100644 --- a/src/test/examples/testlibpq3.c +++ b/src/test/examples/testlibpq3.c @@ -51,14 +51,14 @@ main(int argc, char **argv) /* * If the user supplies a parameter on the command line, use it as the - * conninfo string; otherwise default to setting dbname=template1 and + * conninfo string; otherwise default to setting dbname=postgres and * using environment variables or defaults for all other connection * parameters. */ if (argc > 1) conninfo = argv[1]; else - conninfo = "dbname = template1"; + conninfo = "dbname = postgres"; /* Make a connection to the database */ conn = PQconnectdb(conninfo); diff --git a/src/test/regress/pg_regress.sh b/src/test/regress/pg_regress.sh index 58534346df0..c192edc5156 100644 --- a/src/test/regress/pg_regress.sh +++ b/src/test/regress/pg_regress.sh @@ -1,5 +1,5 @@ #! /bin/sh -# $PostgreSQL: pgsql/src/test/regress/pg_regress.sh,v 1.56 2005/06/20 02:26:50 tgl Exp $ +# $PostgreSQL: pgsql/src/test/regress/pg_regress.sh,v 1.57 2005/06/21 04:02:34 tgl Exp $ me=`basename $0` : ${TMPDIR=/tmp} @@ -441,7 +441,7 @@ then # wait forever, however. i=0 max=60 - until "$bindir/psql" -X $psql_options template1 </dev/null 2>/dev/null + until "$bindir/psql" -X $psql_options postgres </dev/null 2>/dev/null do i=`expr $i + 1` if [ $i -ge $max ] |
