1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-11 20:28:21 +03:00

Make command-line tools smarter about finding a DB to connect to.

If unable to connect to "postgres", try "template1".  This allows things to
work more smoothly in the case where the postgres database has been
dropped.  And just in case that's not good enough, also allow the user to
specify a maintenance database to be used for the initial connection, to
cover the case where neither postgres nor template1 is suitable.
This commit is contained in:
Robert Haas
2011-12-06 08:48:15 -05:00
parent 6ef4ae1d4e
commit 68281e0054
16 changed files with 188 additions and 36 deletions

View File

@ -229,6 +229,18 @@ PostgreSQL documentation
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--maintenance-db=<replaceable class="parameter">dbname</replaceable></></term>
<listitem>
<para>
Specifies the name of the database to connect to discover what other
databases should be clustered. If not specified, the
<literal>postgres</literal> database will be used,
and if that does not exist, <literal>template1</literal> will be used.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>

View File

@ -276,6 +276,19 @@ PostgreSQL documentation
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--maintenance-db=<replaceable class="parameter">dbname</replaceable></></term>
<listitem>
<para>
Specifies the name of the database to connect to when creating the
new database. If not specified, the <literal>postgres</literal>
database will be used; if that does not exist (or if it is the name
of the new database being created), <literal>template1</literal> will
be used.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>

View File

@ -196,6 +196,18 @@ PostgreSQL documentation
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--maintenance-db=<replaceable class="parameter">dbname</replaceable></></term>
<listitem>
<para>
Specifies the name of the database to connect to in order to drop the
target database. If not specified, the <literal>postgres</literal>
database will be used; if that does not exist (or is the database
being dropped), <literal>template1</literal> will be used.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>

View File

@ -243,6 +243,18 @@ PostgreSQL documentation
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--maintenance-db=<replaceable class="parameter">dbname</replaceable></></term>
<listitem>
<para>
Specifies the name of the database to connect to discover what other
databases should be vacuumed. If not specified, the
<literal>postgres</literal> database will be used,
and if that does not exist, <literal>template1</literal> will be used.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>

View File

@ -284,6 +284,18 @@ PostgreSQL documentation
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--maintenance-db=<replaceable class="parameter">dbname</replaceable></></term>
<listitem>
<para>
Specifies the name of the database to connect to discover what other
databases should be vacuumed. If not specified, the
<literal>postgres</literal> database will be used,
and if that does not exist, <literal>template1</literal> will be used.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>