diff options
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/backup.sgml | 12 | ||||
-rw-r--r-- | doc/src/sgml/charset.sgml | 3 | ||||
-rw-r--r-- | doc/src/sgml/client-auth.sgml | 10 | ||||
-rw-r--r-- | doc/src/sgml/installation.sgml | 4 | ||||
-rw-r--r-- | doc/src/sgml/libpq.sgml | 14 | ||||
-rw-r--r-- | doc/src/sgml/manage-ag.sgml | 31 | ||||
-rw-r--r-- | doc/src/sgml/ref/createlang.sgml | 5 | ||||
-rw-r--r-- | doc/src/sgml/ref/drop_database.sgml | 4 | ||||
-rw-r--r-- | doc/src/sgml/ref/initdb.sgml | 11 | ||||
-rw-r--r-- | doc/src/sgml/ref/pg_dumpall.sgml | 4 | ||||
-rw-r--r-- | doc/src/sgml/runtime.sgml | 13 | ||||
-rw-r--r-- | doc/src/sgml/start.sgml | 6 |
12 files changed, 69 insertions, 48 deletions
diff --git a/doc/src/sgml/backup.sgml b/doc/src/sgml/backup.sgml index e4a0d4cb158..cf8244679e9 100644 --- a/doc/src/sgml/backup.sgml +++ b/doc/src/sgml/backup.sgml @@ -1,5 +1,5 @@ <!-- -$PostgreSQL: pgsql/doc/src/sgml/backup.sgml,v 2.66 2005/06/20 13:52:17 tgl Exp $ +$PostgreSQL: pgsql/doc/src/sgml/backup.sgml,v 2.67 2005/06/21 04:02:29 tgl Exp $ --> <chapter id="backup"> <title>Backup and Restore</title> @@ -177,11 +177,11 @@ pg_dumpall > <replaceable>outfile</> </synopsis> The resulting dump can be restored with <application>psql</>: <synopsis> -psql -f <replaceable class="parameter">infile</replaceable> template1 +psql -f <replaceable class="parameter">infile</replaceable> postgres </synopsis> (Actually, you can specify any existing database name to start from, - but if you are reloading in an empty cluster then <literal>template1</> - is the only available choice.) It is always necessary to have + but if you are reloading in an empty cluster then <literal>postgres</> + should generally be used.) It is always necessary to have database superuser access when restoring a <application>pg_dumpall</> dump, as that is required to restore the user and group information. </para> @@ -1223,7 +1223,7 @@ restore_command = 'copy /mnt/server/archivedir/%f "%p"' # Windows in parallel, on different ports. Then you can use something like <programlisting> -pg_dumpall -p 5432 | psql -d template1 -p 6543 +pg_dumpall -p 5432 | psql -d postgres -p 6543 </programlisting> to transfer your data. Or use an intermediate file if you want. @@ -1256,7 +1256,7 @@ cd ~/postgresql-&version; gmake install initdb -D /usr/local/pgsql/data postmaster -D /usr/local/pgsql/data -psql -f backup template1 +psql -f backup postgres </programlisting> See <xref linkend="runtime"> about ways to start and stop the diff --git a/doc/src/sgml/charset.sgml b/doc/src/sgml/charset.sgml index 4f8e5c3e86e..3383fff14ab 100644 --- a/doc/src/sgml/charset.sgml +++ b/doc/src/sgml/charset.sgml @@ -1,4 +1,4 @@ -<!-- $PostgreSQL: pgsql/doc/src/sgml/charset.sgml,v 2.72 2005/04/16 16:50:01 tgl Exp $ --> +<!-- $PostgreSQL: pgsql/doc/src/sgml/charset.sgml,v 2.73 2005/06/21 04:02:29 tgl Exp $ --> <chapter id="charset"> <title>Localization</> @@ -647,6 +647,7 @@ $ <userinput>psql -l</userinput> 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 diff --git a/doc/src/sgml/client-auth.sgml b/doc/src/sgml/client-auth.sgml index 8439174b028..83611d25ffb 100644 --- a/doc/src/sgml/client-auth.sgml +++ b/doc/src/sgml/client-auth.sgml @@ -1,5 +1,5 @@ <!-- -$PostgreSQL: pgsql/doc/src/sgml/client-auth.sgml,v 1.80 2005/06/04 20:42:41 momjian Exp $ +$PostgreSQL: pgsql/doc/src/sgml/client-auth.sgml,v 1.81 2005/06/21 04:02:29 tgl Exp $ --> <chapter id="client-authentication"> @@ -452,17 +452,17 @@ host all all 127.0.0.1/32 trust 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 diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml index 85ae00e8de6..b605ea23ddd 100644 --- a/doc/src/sgml/installation.sgml +++ b/doc/src/sgml/installation.sgml @@ -1,4 +1,4 @@ -<!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.235 2005/06/12 15:51:50 tgl Exp $ --> +<!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.236 2005/06/21 04:02:29 tgl Exp $ --> <chapter id="installation"> <title><![%standalone-include[<productname>PostgreSQL</>]]> @@ -468,7 +468,7 @@ su - postgres </programlisting> Finally, restore your data with <screen> -<userinput>/usr/local/pgsql/bin/psql -d template1 -f <replaceable>outputfile</></userinput> +<userinput>/usr/local/pgsql/bin/psql -d postgres -f <replaceable>outputfile</></userinput> </screen> using the <emphasis>new</> <application>psql</>. </para> diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index fe15c2b1bb3..9c1b94e2be7 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -1,5 +1,5 @@ <!-- -$PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.185 2005/06/12 00:00:20 neilc Exp $ +$PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.186 2005/06/21 04:02:29 tgl Exp $ --> <chapter id="libpq"> @@ -4230,14 +4230,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 + * 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); @@ -4376,14 +4376,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 + * 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); @@ -4518,14 +4518,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 + * 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); diff --git a/doc/src/sgml/manage-ag.sgml b/doc/src/sgml/manage-ag.sgml index e95839f050d..0ac156cb443 100644 --- a/doc/src/sgml/manage-ag.sgml +++ b/doc/src/sgml/manage-ag.sgml @@ -1,5 +1,5 @@ <!-- -$PostgreSQL: pgsql/doc/src/sgml/manage-ag.sgml,v 2.41 2005/06/13 02:40:04 neilc Exp $ +$PostgreSQL: pgsql/doc/src/sgml/manage-ag.sgml,v 2.42 2005/06/21 04:02:30 tgl Exp $ --> <chapter id="managing-databases"> @@ -113,17 +113,20 @@ CREATE DATABASE <replaceable>name</>; <command>initdb</> command when the data storage area is initialized. (See <xref linkend="creating-cluster">.) This database is called - <literal>template1</>.<indexterm><primary>template1</></> So to - create the first <quote>real</> database you can connect to - <literal>template1</>. + <literal>postgres</>.<indexterm><primary>postgres</></> So to + create the first <quote>ordinary</> database you can connect to + <literal>postgres</>. </para> <para> - The name <literal>template1</literal> is no accident: when a new - database is created, the template database is essentially cloned. + A second database, + <literal>template1</literal>,<indexterm><primary>template1</></> + is also created by + <command>initdb</>. Whenever a new database is created within the + cluster, <literal>template1</literal> is essentially cloned. This means that any changes you make in <literal>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 <literal>template1</> for real work, but when used judiciously this feature can be convenient. More details appear in <xref linkend="manage-ag-templatedbs">. </para> @@ -137,7 +140,7 @@ CREATE DATABASE <replaceable>name</>; createdb <replaceable class="parameter">dbname</replaceable> </synopsis> - <command>createdb</> does no magic. It connects to the <literal>template1</> + <command>createdb</> does no magic. It connects to the <literal>postgres</> database and issues the <command>CREATE DATABASE</> command, exactly as described above. The <xref linkend="app-createdb"> reference page contains the invocation @@ -268,13 +271,19 @@ createdb -T template0 <replaceable>dbname</> <para> <literal>template1</> and <literal>template0</> do not have any special status beyond the fact that the name <literal>template1</> is the default - source database name for <command>CREATE DATABASE</> and the default - database-to-connect-to for various programs such as <command>createdb</>. + source database name for <command>CREATE DATABASE</>. For example, one could drop <literal>template1</> and recreate it from <literal>template0</> without any ill effects. This course of action might be advisable if one has carelessly added a bunch of junk in <literal>template1</>. </para> + + <para> + The <literal>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 + <literal>template1</> and may be dropped and recreated if required. + </para> </note> </sect1> diff --git a/doc/src/sgml/ref/createlang.sgml b/doc/src/sgml/ref/createlang.sgml index 3b84e25041e..9829d845b0e 100644 --- a/doc/src/sgml/ref/createlang.sgml +++ b/doc/src/sgml/ref/createlang.sgml @@ -1,5 +1,5 @@ <!-- -$PostgreSQL: pgsql/doc/src/sgml/ref/createlang.sgml,v 1.34 2005/05/29 03:32:18 momjian Exp $ +$PostgreSQL: pgsql/doc/src/sgml/ref/createlang.sgml,v 1.35 2005/06/21 04:02:31 tgl Exp $ PostgreSQL documentation --> @@ -223,6 +223,9 @@ PostgreSQL documentation <screen> <prompt>$ </prompt><userinput>createlang pltcl template1</userinput> </screen> + Note that installing the language into <literal>template1</literal> + will cause it to be automatically installed into subsequently-created + databases as well. </para> </refsect1> diff --git a/doc/src/sgml/ref/drop_database.sgml b/doc/src/sgml/ref/drop_database.sgml index 50ab2cde823..6a51ec356f9 100644 --- a/doc/src/sgml/ref/drop_database.sgml +++ b/doc/src/sgml/ref/drop_database.sgml @@ -1,5 +1,5 @@ <!-- -$PostgreSQL: pgsql/doc/src/sgml/ref/drop_database.sgml,v 1.19 2003/11/29 19:51:38 pgsql Exp $ +$PostgreSQL: pgsql/doc/src/sgml/ref/drop_database.sgml,v 1.20 2005/06/21 04:02:31 tgl Exp $ PostgreSQL documentation --> @@ -32,7 +32,7 @@ DROP DATABASE <replaceable class="PARAMETER">name</replaceable> 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 <literal>template1</literal> or any + to the target database. (Connect to <literal>postgres</literal> or any other database to issue this command.) </para> diff --git a/doc/src/sgml/ref/initdb.sgml b/doc/src/sgml/ref/initdb.sgml index 7f22b0400f4..664a8d8fb58 100644 --- a/doc/src/sgml/ref/initdb.sgml +++ b/doc/src/sgml/ref/initdb.sgml @@ -1,5 +1,5 @@ <!-- -$PostgreSQL: pgsql/doc/src/sgml/ref/initdb.sgml,v 1.34 2005/02/22 02:54:19 momjian Exp $ +$PostgreSQL: pgsql/doc/src/sgml/ref/initdb.sgml,v 1.35 2005/06/21 04:02:31 tgl Exp $ PostgreSQL documentation --> @@ -47,9 +47,12 @@ PostgreSQL documentation 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 <literal>template1</literal> - database. When you later create a new database, everything in the - <literal>template1</literal> database is copied. It contains catalog - tables containing things like built-in data types. + and <literal>postgres</literal> databases. When you later create a + new database, everything in the <literal>template1</literal> database is + copied. (Therefore, anything installed in <literal>template1</literal> + is automatically copied into each database created later.) + The <literal>postgres</literal> database is a default database meant + for use by users, utilities and third party applications. </para> <para> diff --git a/doc/src/sgml/ref/pg_dumpall.sgml b/doc/src/sgml/ref/pg_dumpall.sgml index 5a15ea439a6..857cb1a8a6a 100644 --- a/doc/src/sgml/ref/pg_dumpall.sgml +++ b/doc/src/sgml/ref/pg_dumpall.sgml @@ -1,5 +1,5 @@ <!-- -$PostgreSQL: pgsql/doc/src/sgml/ref/pg_dumpall.sgml,v 1.49 2005/05/29 03:32:18 momjian Exp $ +$PostgreSQL: pgsql/doc/src/sgml/ref/pg_dumpall.sgml,v 1.50 2005/06/21 04:02:31 tgl Exp $ PostgreSQL documentation --> @@ -401,7 +401,7 @@ PostgreSQL documentation <para> To reload this database use, for example: <screen> -<prompt>$</prompt> <userinput>psql -f db.out template1</userinput> +<prompt>$</prompt> <userinput>psql -f db.out postgres</userinput> </screen> (It is not important to which database you connect here since the script file created by <application>pg_dumpall</application> will diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml index 1a2a9935cc3..43334453921 100644 --- a/doc/src/sgml/runtime.sgml +++ b/doc/src/sgml/runtime.sgml @@ -1,5 +1,5 @@ <!-- -$PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.329 2005/06/17 22:32:42 tgl Exp $ +$PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.330 2005/06/21 04:02:30 tgl Exp $ --> <chapter Id="runtime"> @@ -54,8 +54,13 @@ $PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.329 2005/06/17 22:32:42 tgl Exp (<acronym>SQL</acronym> 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 - <literal>template1</literal>. As the name suggests, this will be used + database cluster will contain a database named <literal>postgres</literal>, + which is meant as a default database for use by utilities, users and third + party applications. The database server itself does not require the + <literal>postgres</literal> database to exist, but many external utility + programs assume it exists. Another database created within each cluster + during initialization is called + <literal>template1</literal>. As the name suggests, this will be used as a template for subsequently created databases; it should not be used for actual work. (See <xref linkend="managing-databases"> for information about creating new databases within a cluster.) @@ -5319,7 +5324,7 @@ ssh -L 3333:foo.com:5432 joe@foo.com to connect to. In order to connect to the database server using this tunnel, you connect to port 3333 on the local machine: <programlisting> -psql -h localhost -p 3333 template1 +psql -h localhost -p 3333 postgres </programlisting> To the database server it will then look as though you are really user <literal>joe@foo.com</literal> and it will use whatever diff --git a/doc/src/sgml/start.sgml b/doc/src/sgml/start.sgml index 3ae094b37c0..c2ce466fe80 100644 --- a/doc/src/sgml/start.sgml +++ b/doc/src/sgml/start.sgml @@ -1,5 +1,5 @@ <!-- -$PostgreSQL: pgsql/doc/src/sgml/start.sgml,v 1.38 2005/01/08 01:44:08 tgl Exp $ +$PostgreSQL: pgsql/doc/src/sgml/start.sgml,v 1.39 2005/06/21 04:02:30 tgl Exp $ --> <chapter id="tutorial-start"> @@ -183,7 +183,7 @@ createdb: command not found <para> Another response could be this: <screen> -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"? @@ -196,7 +196,7 @@ No such file or directory <para> Another response could be this: <screen> -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 </screen> where your own login name is mentioned. This will happen if the |