summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorPeter Eisentraut2002-08-10 16:57:32 +0000
committerPeter Eisentraut2002-08-10 16:57:32 +0000
commit029aa97f2d90a2ef97b2c0ca917bea7268392eb1 (patch)
treeb5a7c08bf2030f7c0b4b1a6cc64ba6e2a809efdb /doc/src
parent60ac5b805e63ee0055fa9ff44a8486953f6dcbbc (diff)
Make sure all clients have the same understanding of default user name
and database. In particular, make script wrappers understand the PGDATABASE environment variable.
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/ref/createdb.sgml18
-rw-r--r--doc/src/sgml/ref/createlang.sgml5
-rw-r--r--doc/src/sgml/ref/createuser.sgml8
-rw-r--r--doc/src/sgml/ref/dropdb.sgml6
-rw-r--r--doc/src/sgml/ref/droplang.sgml5
-rw-r--r--doc/src/sgml/ref/dropuser.sgml6
-rw-r--r--doc/src/sgml/ref/pg_dump.sgml20
-rw-r--r--doc/src/sgml/ref/pg_restore.sgml4
-rw-r--r--doc/src/sgml/ref/vacuumdb.sgml14
9 files changed, 36 insertions, 50 deletions
diff --git a/doc/src/sgml/ref/createdb.sgml b/doc/src/sgml/ref/createdb.sgml
index d0849388cd5..9e0de5572c3 100644
--- a/doc/src/sgml/ref/createdb.sgml
+++ b/doc/src/sgml/ref/createdb.sgml
@@ -1,5 +1,5 @@
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/ref/createdb.sgml,v 1.27 2002/07/28 15:22:20 petere Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/ref/createdb.sgml,v 1.28 2002/08/10 16:57:31 petere Exp $
PostgreSQL documentation
-->
@@ -238,6 +238,16 @@ PostgreSQL documentation
<variablelist>
<varlistentry>
+ <term><envar>PGDATABASE</envar></term>
+ <listitem>
+ <para>
+ If set, the name of the database to create, unless overridden on
+ the command line.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><envar>PGHOST</envar></term>
<term><envar>PGPORT</envar></term>
<term><envar>PGUSER</envar></term>
@@ -246,7 +256,7 @@ PostgreSQL documentation
<para>
Default connection parameters. <envar>PGUSER</envar> also
determines the name of the database to create, if it is not
- specified in the command line.
+ specified on the command line or by <envar>PGDATABASE</envar>.
</para>
</listitem>
</varlistentry>
@@ -257,7 +267,6 @@ PostgreSQL documentation
<refsect1 id="R1-APP-CREATEDB-2">
<title>Examples</title>
- <informalexample>
<para>
To create the database <literal>demo</literal> using the default
database server:
@@ -268,9 +277,7 @@ PostgreSQL documentation
The response is the same as you would have gotten from running the
<command>CREATE DATABASE</command> <acronym>SQL</acronym> command.
</para>
- </informalexample>
- <informalexample>
<para>
To create the database <literal>demo</literal> using the
server on host <literal>eden</>, port 5000, using the
@@ -282,7 +289,6 @@ PostgreSQL documentation
<computeroutput>CREATE DATABASE</computeroutput>
</screen>
</para>
- </informalexample>
</refsect1>
diff --git a/doc/src/sgml/ref/createlang.sgml b/doc/src/sgml/ref/createlang.sgml
index 7ad26ae82e9..b454374deb2 100644
--- a/doc/src/sgml/ref/createlang.sgml
+++ b/doc/src/sgml/ref/createlang.sgml
@@ -1,5 +1,5 @@
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/ref/createlang.sgml,v 1.25 2002/07/28 15:22:20 petere Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/ref/createlang.sgml,v 1.26 2002/08/10 16:57:31 petere Exp $
PostgreSQL documentation
-->
@@ -168,6 +168,7 @@ PostgreSQL documentation
<variablelist>
<varlistentry>
+ <term><envar>PGDATABASE</envar></term>
<term><envar>PGHOST</envar></term>
<term><envar>PGPORT</envar></term>
<term><envar>PGUSER</envar></term>
@@ -214,7 +215,6 @@ PostgreSQL documentation
<refsect1>
<title>Examples</title>
- <informalexample>
<para>
To install <literal>pltcl</literal> into the database
<literal>template1</literal>:
@@ -222,7 +222,6 @@ PostgreSQL documentation
<prompt>$ </prompt><userinput>createlang pltcl template1</userinput>
</screen>
</para>
- </informalexample>
</refsect1>
<refsect1>
diff --git a/doc/src/sgml/ref/createuser.sgml b/doc/src/sgml/ref/createuser.sgml
index d4be6e7b25d..1576062aff0 100644
--- a/doc/src/sgml/ref/createuser.sgml
+++ b/doc/src/sgml/ref/createuser.sgml
@@ -1,5 +1,5 @@
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/ref/createuser.sgml,v 1.26 2002/07/28 15:22:20 petere Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/ref/createuser.sgml,v 1.27 2002/08/10 16:57:31 petere Exp $
PostgreSQL documentation
-->
@@ -128,7 +128,7 @@ PostgreSQL documentation
<listitem>
<para>
The new user is allowed to create other users.
- (Note: actually, this makes the new user a <firstterm>superuser</>.
+ (Note: Actually, this makes the new user a <firstterm>superuser</>.
The option is poorly named.)
</para>
</listitem>
@@ -264,7 +264,6 @@ PostgreSQL documentation
<refsect1>
<title>Examples</title>
- <informalexample>
<para>
To create a user <literal>joe</literal> on the default database
server:
@@ -275,9 +274,7 @@ PostgreSQL documentation
<computeroutput>CREATE USER</computeroutput>
</screen>
</para>
- </informalexample>
- <informalexample>
<para>
To create the same user <literal>joe</literal> using the
server on host <literal>eden</>, port 5000, avoiding the prompts and
@@ -288,7 +285,6 @@ PostgreSQL documentation
<computeroutput>CREATE USER</computeroutput>
</screen>
</para>
- </informalexample>
</refsect1>
diff --git a/doc/src/sgml/ref/dropdb.sgml b/doc/src/sgml/ref/dropdb.sgml
index e2fd2e3eccf..aaecbf821ce 100644
--- a/doc/src/sgml/ref/dropdb.sgml
+++ b/doc/src/sgml/ref/dropdb.sgml
@@ -1,5 +1,5 @@
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/ref/dropdb.sgml,v 1.16 2002/07/28 15:22:20 petere Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/ref/dropdb.sgml,v 1.17 2002/08/10 16:57:31 petere Exp $
PostgreSQL documentation
-->
@@ -191,7 +191,6 @@ PostgreSQL documentation
<refsect1 id="R1-APP-DROPDB-2">
<title>Examples</title>
- <informalexample>
<para>
To destroy the database <literal>demo</literal> on the default
database server:
@@ -200,9 +199,7 @@ PostgreSQL documentation
<computeroutput>DROP DATABASE</computeroutput>
</screen>
</para>
- </informalexample>
- <informalexample>
<para>
To destroy the database <literal>demo</literal> using the
server on host <literal>eden</literal>, port 5000, with verification and a peek
@@ -215,7 +212,6 @@ Are you sure? (y/n) </computeroutput><userinput>y</userinput>
DROP DATABASE</computeroutput>
</screen>
</para>
- </informalexample>
</refsect1>
diff --git a/doc/src/sgml/ref/droplang.sgml b/doc/src/sgml/ref/droplang.sgml
index 186af6e2a09..d6f14cfbcae 100644
--- a/doc/src/sgml/ref/droplang.sgml
+++ b/doc/src/sgml/ref/droplang.sgml
@@ -1,5 +1,5 @@
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/ref/droplang.sgml,v 1.19 2002/07/28 15:22:20 petere Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/ref/droplang.sgml,v 1.20 2002/08/10 16:57:31 petere Exp $
PostgreSQL documentation
-->
@@ -157,6 +157,7 @@ PostgreSQL documentation
<variablelist>
<varlistentry>
+ <term><envar>PGDATABASE</envar></term>
<term><envar>PGHOST</envar></term>
<term><envar>PGPORT</envar></term>
<term><envar>PGUSER</envar></term>
@@ -196,14 +197,12 @@ PostgreSQL documentation
<refsect1>
<title>Examples</title>
- <informalexample>
<para>
To remove <literal>pltcl</literal>:
<screen>
<prompt>$ </prompt><userinput>droplang pltcl dbname</userinput>
</screen>
</para>
- </informalexample>
</refsect1>
<refsect1>
diff --git a/doc/src/sgml/ref/dropuser.sgml b/doc/src/sgml/ref/dropuser.sgml
index 5d45347ee1c..9fdd3c72d3b 100644
--- a/doc/src/sgml/ref/dropuser.sgml
+++ b/doc/src/sgml/ref/dropuser.sgml
@@ -1,5 +1,5 @@
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/ref/dropuser.sgml,v 1.19 2002/07/28 15:22:20 petere Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/ref/dropuser.sgml,v 1.20 2002/08/10 16:57:31 petere Exp $
PostgreSQL documentation
-->
@@ -181,7 +181,6 @@ PostgreSQL documentation
<refsect1>
<title>Examples</title>
- <informalexample>
<para>
To remove user <literal>joe</literal> from the default database
server:
@@ -190,9 +189,7 @@ PostgreSQL documentation
<computeroutput>DROP USER</computeroutput>
</screen>
</para>
- </informalexample>
- <informalexample>
<para>
To remove user <literal>joe</literal> using the postmaster on host
<literal>eden</literal>, port 5000, with verification and a peek at the underlying
@@ -205,7 +202,6 @@ Are you sure? (y/n) </computeroutput><userinput>y</userinput>
DROP USER</computeroutput>
</screen>
</para>
- </informalexample>
</refsect1>
diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml
index 7969489f11c..2f5085a52d5 100644
--- a/doc/src/sgml/ref/pg_dump.sgml
+++ b/doc/src/sgml/ref/pg_dump.sgml
@@ -1,5 +1,5 @@
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/ref/pg_dump.sgml,v 1.46 2002/07/28 15:22:20 petere Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/ref/pg_dump.sgml,v 1.47 2002/08/10 16:57:31 petere Exp $
PostgreSQL documentation
-->
@@ -43,7 +43,7 @@ PostgreSQL documentation
<arg>-p <replaceable>port</replaceable></arg>
<arg>-U <replaceable>username</replaceable></arg>
<arg>-W</arg>
- <arg choice="plain"><replaceable>dbname</replaceable></arg>
+ <arg><replaceable>dbname</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>
@@ -126,7 +126,10 @@ PostgreSQL documentation
<term><replaceable class="parameter">dbname</replaceable></term>
<listitem>
<para>
- Specifies the name of the database to be dumped.
+ Specifies the name of the database to be dumped. If this is
+ not specified, the environment variable
+ <envar>PGDATABASE</envar> is used. If that is not set, the
+ user name specified for the connection is used.
</para>
</listitem>
</varlistentry>
@@ -562,7 +565,7 @@ PostgreSQL documentation
<term><option>-U <replaceable>username</replaceable></option></term>
<listitem>
<para>
- Connect as the given user.
+ Connect as the given user
</para>
</listitem>
</varlistentry>
@@ -588,15 +591,6 @@ PostgreSQL documentation
<variablelist>
<varlistentry>
<term><envar>PGDATABASE</envar></term>
-
- <listitem>
- <para>
- Database to dump, unless overridden on the command line.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
<term><envar>PGHOST</envar></term>
<term><envar>PGPORT</envar></term>
<term><envar>PGUSER</envar></term>
diff --git a/doc/src/sgml/ref/pg_restore.sgml b/doc/src/sgml/ref/pg_restore.sgml
index e89d76bbc1b..7f5432fc7ae 100644
--- a/doc/src/sgml/ref/pg_restore.sgml
+++ b/doc/src/sgml/ref/pg_restore.sgml
@@ -1,4 +1,4 @@
-<!-- $Header: /cvsroot/pgsql/doc/src/sgml/ref/pg_restore.sgml,v 1.29 2002/07/28 15:22:20 petere Exp $ -->
+<!-- $Header: /cvsroot/pgsql/doc/src/sgml/ref/pg_restore.sgml,v 1.30 2002/08/10 16:57:31 petere Exp $ -->
<refentry id="APP-PGRESTORE">
<docinfo>
@@ -475,7 +475,7 @@
<term><option>-U <replaceable>username</replaceable></option></term>
<listitem>
<para>
- Connect as the given user.
+ Connect as the given user
</para>
</listitem>
</varlistentry>
diff --git a/doc/src/sgml/ref/vacuumdb.sgml b/doc/src/sgml/ref/vacuumdb.sgml
index 37debc1b845..f29eabce1b4 100644
--- a/doc/src/sgml/ref/vacuumdb.sgml
+++ b/doc/src/sgml/ref/vacuumdb.sgml
@@ -1,5 +1,5 @@
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/ref/vacuumdb.sgml,v 1.22 2002/07/28 15:22:21 petere Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/ref/vacuumdb.sgml,v 1.23 2002/08/10 16:57:31 petere Exp $
PostgreSQL documentation
-->
@@ -75,6 +75,11 @@ PostgreSQL documentation
<listitem>
<para>
Specifies the name of the database to be cleaned or analyzed.
+ If this is not specified and <option>-a</option> (or
+ <option>--all</option>) is not used, the database name is read
+ from the environment variable <envar>PGDATABASE</envar>. If
+ that is not set, the user name specified for the connection is
+ used.
</para>
</listitem>
</varlistentry>
@@ -251,6 +256,7 @@ PostgreSQL documentation
<variablelist>
<varlistentry>
+ <term><envar>PGDATABASE</envar></term>
<term><envar>PGHOST</envar></term>
<term><envar>PGPORT</envar></term>
<term><envar>PGUSER</envar></term>
@@ -268,16 +274,13 @@ PostgreSQL documentation
<refsect1>
<title>Examples</title>
- <informalexample>
<para>
To clean the database <literal>test</literal>:
<screen>
<prompt>$ </prompt><userinput>vacuumdb test</userinput>
</screen>
</para>
- </informalexample>
- <informalexample>
<para>
To clean and analyze for the optimizer a database named
<literal>bigdb</literal>:
@@ -285,9 +288,7 @@ PostgreSQL documentation
<prompt>$ </prompt><userinput>vacuumdb --analyze bigdb</userinput>
</screen>
</para>
- </informalexample>
- <informalexample>
<para>
To clean a single table
<literal>foo</literal> in a database named
@@ -297,7 +298,6 @@ PostgreSQL documentation
<prompt>$ </prompt><userinput>vacuumdb --analyze --verbose --table 'foo(bar)' xyzzy</userinput>
</screen>
</para>
- </informalexample>
</refsect1>