Example usage
-select dblink_connect('dbname=template1');
+select dblink_connect('dbname=postgres');
dblink_connect
----------------
OK
(1 row)
-select dblink_connect('myconn','dbname=template1');
+select dblink_connect('myconn','dbname=postgres');
dblink_connect
----------------
OK
Example usage
-test=# select dblink_connect('dbname=template1');
+test=# select dblink_connect('dbname=postgres');
dblink_connect
----------------
OK
Example usage
-test=# select dblink_connect('dbname=template1');
+test=# select dblink_connect('dbname=postgres');
dblink_connect
----------------
OK
Example usage
-test=# select dblink_connect('dbname=template1');
+test=# select dblink_connect('dbname=postgres');
dblink_connect
----------------
OK
Example usage
-test=# select dblink_current_query() from (select dblink('dbname=template1','select oid, proname from pg_proc where proname = ''byteacat''') as f1) as t1;
+test=# select dblink_current_query() from (select dblink('dbname=postgres','select oid, proname from pg_proc where proname = ''byteacat''') as f1) as t1;
dblink_current_query
-----------------------------------------------------------------------------------------------------------------------------------------------------
- select dblink_current_query() from (select dblink('dbname=template1','select oid, proname from pg_proc where proname = ''byteacat''') as f1) as t1;
+ select dblink_current_query() from (select dblink('dbname=postgres','select oid, proname from pg_proc where proname = ''byteacat''') as f1) as t1;
(1 row)
==================================================================
Example usage
-select * from dblink('dbname=template1','select proname, prosrc from pg_proc')
+select * from dblink('dbname=postgres','select proname, prosrc from pg_proc')
as t1(proname name, prosrc text) where proname like 'bytea%';
proname | prosrc
------------+------------
byteaout | byteaout
(12 rows)
-select dblink_connect('dbname=template1');
+select dblink_connect('dbname=postgres');
dblink_connect
----------------
OK
create view myremote_pg_proc as
select *
- from dblink('dbname=template1','select proname, prosrc from pg_proc')
+ from dblink('dbname=postgres','select proname, prosrc from pg_proc')
as t1(proname name, prosrc text);
Then you can simply write:
if (my_opts->dbname == NULL)
{
- my_opts->dbname = "template1";
+ my_opts->dbname = "postgres";
my_opts->nodb = true;
}
pgconn = sql_conn(my_opts);
#!/bin/sh
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- #
-# Package : reindexdb Version : $Revision: 1.5 $
+# Package : reindexdb Version : $Revision: 1.6 $
# Date : 05/08/2002 Author : Shaun Thomas
# Req : psql, sh, perl, sed Type : Utility
#
# connect to. That's the list we'll be using. It's also why it's
# a good idea for this to be run as a super-user.
sql='SELECT datname FROM pg_database WHERE datallowconn'
- dbname=`$PSQL $PSQLOPT -q -t -A -d template1 -c "$sql"`
+ dbname=`$PSQL $PSQLOPT -q -t -A -d postgres -c "$sql"`
# Ok, if it's not all databases, make sure at least one database is
# specified before continuing.
boundaries. For example, it adds an extra digit to the lower
boundary if the resulting interval includes a power of ten:
- template1=> select '10(+-)1'::seg as seg;
+ postgres=> select '10(+-)1'::seg as seg;
seg
---------
9.0 .. 11 -- should be: 9 .. 11
Backup and Restore
The resulting dump can be restored with
psql>:
-psql -f infile template1
+psql -f infile postgres
(Actually, you can specify any existing database name to start from,
- but if you are reloading in an empty cluster then template1>
- is the only available choice.) It is always necessary to have
+ but if you are reloading in an empty cluster then postgres>
+ should generally be used.) It is always necessary to have
database superuser access when restoring a
pg_dumpall>
dump, as that is required to restore the user and group information.
in parallel, on different ports. Then you can use something like
-pg_dumpall -p 5432 | psql -d template1 -p 6543
+pg_dumpall -p 5432 | psql -d postgres -p 6543
to transfer your data. Or use an intermediate file if you want.
gmake install
initdb -D /usr/local/pgsql/data
postmaster -D /usr/local/pgsql/data
-psql -f backup template1
+psql -f backup postgres
See about ways to start and stop the
-
+
Localization>
euc_kr | t-ishii | EUC_KR
euc_tw | t-ishii | EUC_TW
mule_internal | t-ishii | MULE_INTERNAL
+ postgres | t-ishii | EUC_JP
regression | t-ishii | SQL_ASCII
template1 | t-ishii | EUC_JP
test | t-ishii | EUC_JP
host all all 127.0.0.1 255.255.255.255 trust
# Allow any user from any host with IP address 192.168.93.x to connect
-# to database "template1" as the same user name that ident reports for
+# to database "postgres" as the same user name that ident reports for
# the connection (typically the Unix user name).
#
# TYPE DATABASE USER CIDR-ADDRESS METHOD
-host template1 all 192.168.93.0/24 ident sameuser
+host postgres all 192.168.93.0/24 ident sameuser
# Allow a user from host 192.168.12.10 to connect to database
-# "template1" if the user's password is correctly supplied.
+# "postgres" if the user's password is correctly supplied.
#
# TYPE DATABASE USER CIDR-ADDRESS METHOD
-host template1 all 192.168.12.10/32 md5
+host postgres all 192.168.12.10/32 md5
# In the absence of preceding "host" lines, these two lines will
# reject all connection from 192.168.54.1 (since that entry will be
-
+
PostgreSQL>]]>
Finally, restore your data with
-/usr/local/pgsql/bin/psql -d template1 -f outputfile>
+/usr/local/pgsql/bin/psql -d postgres -f outputfile>
/*
* If the user supplies a parameter on the command line, use it as
- * the conninfo string; otherwise default to setting dbname=template1
+ * the 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);
/*
* If the user supplies a parameter on the command line, use it as
- * the conninfo string; otherwise default to setting dbname=template1
+ * the 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);
/*
* If the user supplies a parameter on the command line, use it as
- * the conninfo string; otherwise default to setting dbname=template1
+ * the 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);
initdb> command when the data storage area is
initialized. (See .) This
database is called
-
template1>.template1>> So to
- create the first real> database you can connect to
- template1>.
+
postgres>.postgres>> So to
+ create the first ordinary> database you can connect to
+ postgres>.
- The name template1 is no accident: when a new
- database is created, the template database is essentially cloned.
+ A second database,
+ is also created by
+ initdb>. Whenever a new database is created within the
+ cluster, template1 is essentially cloned.
This means that any changes you make in template1> are
- propagated to all subsequently created databases. This implies that
- you should not use the template database for real work, but when
+ propagated to all subsequently created databases. Therefore it is
+ unwise to use template1> for real work, but when
used judiciously this feature can be convenient. More details
appear in .
createdb dbname
- createdb> does no magic. It connects to the template1>
+ createdb> does no magic. It connects to the postgres>
database and issues the CREATE DATABASE> command,
exactly as described above.
The reference page contains the invocation
template1> and template0> do not have any special
status beyond the fact that the name template1> is the default
- source database name for CREATE DATABASE> and the default
- database-to-connect-to for various programs such as createdb>.
+ source database name for CREATE DATABASE>.
For example, one could drop template1> and recreate it from
template0> without any ill effects. This course of action
might be advisable if one has carelessly added a bunch of junk in
template1>.
+
+ The postgres> database is also created when a database
+ cluster is initialized. This database is meant as a default database for
+ users and applications to connect to. It is simply a copy of
+ template1> and may be dropped and recreated if required.
+
$ createlang pltcl template1
+ Note that installing the language into template1
+ will cause it to be automatically installed into subsequently-created
+ databases as well.
catalog entries for the database and deletes the directory
containing the data. It can only be executed by the database owner.
Also, it cannot be executed while you or anyone else are connected
- to the target database. (Connect to template1 or any
+ to the target database. (Connect to postgres or any
other database to issue this command.)
which the database data will live, generating the shared catalog
tables (tables that belong to the whole cluster rather than to any
particular database), and creating the template1
- database. When you later create a new database, everything in the
- template1 database is copied. It contains catalog
- tables containing things like built-in data types.
+ and postgres databases. When you later create a
+ new database, everything in the template1 database is
+ copied. (Therefore, anything installed in template1
+ is automatically copied into each database created later.)
+ The postgres database is a default database meant
+ for use by users, utilities and third party applications.
To reload this database use, for example:
-
$ psql -f db.out template1
+
$ psql -f db.out postgres
(It is not important to which database you connect here since the
script file created by
pg_dumpall will
(
SQL uses the term catalog cluster.) A
database cluster is a collection of databases that is managed by a
single instance of a running database server. After initialization, a
- database cluster will contain a database named
- template1. As the name suggests, this will be used
+ database cluster will contain a database named postgres,
+ which is meant as a default database for use by utilities, users and third
+ party applications. The database server itself does not require the
+ postgres database to exist, but many external utility
+ programs assume it exists. Another database created within each cluster
+ during initialization is called
+ template1. As the name suggests, this will be used
as a template for subsequently created databases; it should not be
used for actual work. (See for
information about creating new databases within a cluster.)
to connect to. In order to connect to the database server using
this tunnel, you connect to port 3333 on the local machine:
-psql -h localhost -p 3333 template1
+psql -h localhost -p 3333 postgres
To the database server it will then look as though you are really
user joe@foo.com and it will use whatever
Another response could be this:
-createdb: could not connect to database template1: could not connect to server:
+createdb: could not connect to database postgres: could not connect to server:
No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
Another response could be this:
-createdb: could not connect to database template1: FATAL: user "joe" does not
+createdb: could not connect to database postgres: FATAL: user "joe" does not
exist
where your own login name is mentioned. This will happen if the
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.159 2005/06/06 20:22:57 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.160 2005/06/21 04:02:31 tgl Exp $
*
*-------------------------------------------------------------------------
*/
DefElem *dencoding = NULL;
char *dbname = stmt->dbname;
char *dbowner = NULL;
- char *dbtemplate = NULL;
+ const char *dbtemplate = NULL;
int encoding = -1;
#ifndef WIN32
*
* To create the database cluster, we create the directory that contains
* all its data, create the files that hold the global tables, create
- * a few other control files for it, and create two databases: the
- * template0 and template1 databases.
+ * a few other control files for it, and create three databases: the
+ * template databases "template0" and "template1", and a default user
+ * database "postgres".
*
* The template databases are ordinary PostgreSQL databases. template0
* is never supposed to change after initdb, whereas template1 can be
* changed to add site-local standard data. Either one can be copied
* to produce a new database.
*
+ * For largely-historical reasons, the template1 database is the one built
+ * by the basic bootstrap process. After it is complete, template0 and
+ * the default database, postgres, are made just by copying template1.
+ *
* To create template1, we run the postgres (backend) program in bootstrap
* mode and feed it data from the postgres.bki library file. After this
* initial bootstrap phase, some additional stuff is created by normal
* just embedded into this program (yeah, it's ugly), but larger chunks
* are taken from script files.
*
- * template0 is made just by copying the completed template1.
*
* Note:
* The program has some memory leakage - it isn't worth cleaning it up.
*
- *
* This is a C implementation of the previous shell script for setting up a
* PostgreSQL cluster location, and should be highly compatible with it.
* author of C translation: Andrew Dunstan mailto:andrew@dunslane.net
* Portions Copyright (c) 1994, Regents of the University of California
* Portions taken from FreeBSD.
*
- * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.84 2005/06/17 22:32:47 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.85 2005/06/21 04:02:32 tgl Exp $
*
*-------------------------------------------------------------------------
*/
static void setup_schema(void);
static void vacuum_db(void);
static void make_template0(void);
+static void make_postgres(void);
static void trapsig(int signum);
static void check_ok(void);
static char *escape_quotes(const char *src);
* We use the OID of template0 to determine lastsysoid
*/
"UPDATE pg_database SET datlastsysoid = "
- " (SELECT oid::int4 - 1 FROM pg_database "
+ " (SELECT oid FROM pg_database "
" WHERE datname = 'template0');\n",
/*
check_ok();
}
+/*
+ * copy template1 to postgres
+ */
+static void
+make_postgres(void)
+{
+ PG_CMD_DECL;
+ char **line;
+ static char *postgres_setup[] = {
+ "CREATE DATABASE postgres;\n",
+ NULL
+ };
+
+ fputs(_("copying template1 to postgres ... "), stdout);
+ fflush(stdout);
+
+ snprintf(cmd, sizeof(cmd),
+ "\"%s\" %s template1 >%s",
+ backend_exec, backend_options,
+ DEVNULL);
+
+ PG_CMD_OPEN;
+
+ for (line = postgres_setup; *line; line++)
+ PG_CMD_PUTS(*line);
+
+ PG_CMD_CLOSE;
+
+ check_ok();
+}
+
/*
* signal handler in case we are interrupted.
make_template0();
+ make_postgres();
+
if (authwarning != NULL)
fprintf(stderr, "%s", authwarning);
*
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.57 2005/05/04 22:35:15 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.58 2005/06/21 04:02:32 tgl Exp $
*
*-------------------------------------------------------------------------
*/
for (i = 0; i < wait_seconds; i++)
{
if ((conn = PQsetdbLogin(NULL, portstr, NULL, NULL,
- "template1", NULL, NULL)) != NULL &&
+ "postgres", NULL, NULL)) != NULL &&
(PQstatus(conn) == CONNECTION_OK ||
(strcmp(PQerrorMessage(conn),
PQnoPasswordSupplied) == 0)))
* Portions Copyright (c) 1994, Regents of the University of California
*
*
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.59 2005/04/18 23:47:52 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.60 2005/06/21 04:02:32 tgl Exp $
*
*-------------------------------------------------------------------------
*/
}
- conn = connectDatabase("template1", pghost, pgport, pguser, force_password);
+ conn = connectDatabase("postgres", pghost, pgport, pguser, force_password);
printf("--\n-- PostgreSQL database cluster dump\n--\n\n");
if (verbose)
dumpTimestamp("Started on");
- printf("\\connect \"template1\"\n\n");
+ printf("\\connect \"postgres\"\n\n");
if (!data_only)
{
/*
* Win32 has to use double-quotes for args, rather than single quotes.
* Strangely enough, this is the only place we pass a database name on
- * the command line, except template1 that doesn't need quoting.
+ * the command line, except "postgres" which doesn't need quoting.
*/
#ifndef WIN32
appendPQExpBuffer(cmd, "%s\"%s\" %s -Fp '", SYSTEMQUOTE, pg_dump_bin,
*
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.117 2005/06/14 02:57:41 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.118 2005/06/21 04:02:33 tgl Exp $
*/
#include "postgres_fe.h"
{
need_pass = false;
pset.db = PQsetdbLogin(options.host, options.port, NULL, NULL,
- options.action == ACT_LIST_DB ? "template1" : options.dbname,
+ options.action == ACT_LIST_DB ? "postgres" : options.dbname,
username, password);
if (PQstatus(pset.db) == CONNECTION_BAD &&
*
* Portions Copyright (c) 2002-2005, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/scripts/clusterdb.c,v 1.12 2005/01/01 05:43:08 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/scripts/clusterdb.c,v 1.13 2005/06/21 04:02:33 tgl Exp $
*
*-------------------------------------------------------------------------
*/
PGresult *result;
int i;
- conn = connectDatabase("template1", host, port, username, password, progname);
+ conn = connectDatabase("postgres", host, port, username, password, progname);
result = executeQuery(conn, "SELECT datname FROM pg_database WHERE datallowconn;", progname, echo);
PQfinish(conn);
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/bin/scripts/createdb.c,v 1.14 2004/12/31 22:03:17 pgsql Exp $
+ * $PostgreSQL: pgsql/src/bin/scripts/createdb.c,v 1.15 2005/06/21 04:02:33 tgl Exp $
*
*-------------------------------------------------------------------------
*/
appendPQExpBuffer(&sql, " TEMPLATE %s", fmtId(template));
appendPQExpBuffer(&sql, ";\n");
- conn = connectDatabase("template1", host, port, username, password, progname);
+ conn = connectDatabase(strcmp(dbname, "postgres") == 0 ? "template1" : "postgres",
+ host, port, username, password, progname);
if (echo)
printf("%s", sql.data);
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/bin/scripts/createuser.c,v 1.16 2004/12/31 22:03:17 pgsql Exp $
+ * $PostgreSQL: pgsql/src/bin/scripts/createuser.c,v 1.17 2005/06/21 04:02:33 tgl Exp $
*
*-------------------------------------------------------------------------
*/
appendPQExpBuffer(&sql, " NOCREATEUSER");
appendPQExpBuffer(&sql, ";\n");
- conn = connectDatabase("template1", host, port, username, password, progname);
+ conn = connectDatabase("postgres", host, port, username, password, progname);
if (echo)
printf("%s", sql.data);
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/bin/scripts/dropdb.c,v 1.14 2004/12/31 22:03:17 pgsql Exp $
+ * $PostgreSQL: pgsql/src/bin/scripts/dropdb.c,v 1.15 2005/06/21 04:02:33 tgl Exp $
*
*-------------------------------------------------------------------------
*/
appendPQExpBuffer(&sql, "DROP DATABASE %s;\n",
fmtId(dbname));
- conn = connectDatabase("template1", host, port, username, password, progname);
+ conn = connectDatabase(strcmp(dbname, "postgres") == 0 ? "template1" : "postgres",
+ host, port, username, password, progname);
if (echo)
printf("%s", sql.data);
* 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 $
*
*-------------------------------------------------------------------------
*/
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);
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/bin/scripts/vacuumdb.c,v 1.12 2004/12/31 22:03:17 pgsql Exp $
+ * $PostgreSQL: pgsql/src/bin/scripts/vacuumdb.c,v 1.13 2005/06/21 04:02:33 tgl Exp $
*
*-------------------------------------------------------------------------
*/
PGresult *result;
int i;
- conn = connectDatabase("template1", host, port, username, password, progname);
+ conn = connectDatabase("postgres", host, port, username, password, progname);
result = executeQuery(conn, "SELECT datname FROM pg_database WHERE datallowconn;", progname, echo);
PQfinish(conn);
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.279 2005/06/20 10:29:37 teodor Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.280 2005/06/21 04:02:33 tgl Exp $
*
*-------------------------------------------------------------------------
*/
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 200506201
+#define CATALOG_VERSION_NO 200506202
#endif
if (getenv("SQLOPT")) ECPGdebug(1,stderr);
exec sql whenever sqlerror do sqlprint();
- exec sql connect to template1;
+ exec sql connect to postgres;
exec sql allocate descriptor mydesc;
exec sql select tablename into descriptor mydesc from pg_tables;
# A service is a set of named connection parameters. You may specify
# multiple services in this file. Each starts with a service name in
# brackets. Subsequent lines have connection configuration parameters of
-# the pattern "param=value". A sample configuration for template1 is
+# the pattern "param=value". A sample configuration for postgres is
# included in this file. Lines beginning with '#' are comments.
#
# Copy this to your sysconf directory (typically /usr/local/pgsql/etc) and
# rename it pg_service.conf.
#
#
-#[template1]
-#dbname=template1
+#[postgres]
+#dbname=postgres
#user=postgres
#!/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
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
/*
* 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);
/*
* 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);
/*
* 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);
#! /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}
# wait forever, however.
i=0
max=60
- until "$bindir/psql" -X $psql_options template1 /dev/null
+ until "$bindir/psql" -X $psql_options postgres /dev/null
do
i=`expr $i + 1`
if [ $i -ge $max ]