Commit 7920d033 authored by Peter Eisentraut's avatar Peter Eisentraut

Put documentation of backslash commands back in alphabetical order

parent 51ad1784
...@@ -730,19 +730,32 @@ testdb=> ...@@ -730,19 +730,32 @@ testdb=>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><literal>\cd [ <replaceable>directory</replaceable> ]</literal></term> <term><literal>\c</literal> or <literal>\connect</literal> <literal>[ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ]</literal></term>
<listitem> <listitem>
<para> <para>
Changes the current working directory to Establishes a new connection to a <productname>PostgreSQL</>
<replaceable>directory</replaceable>. Without argument, changes server. If the new connection is successfully made, the
to the current user's home directory. previous connection is closed. If any of <replaceable
class="parameter">dbname</replaceable>, <replaceable
class="parameter">username</replaceable>, <replaceable
class="parameter">host</replaceable> or <replaceable
class="parameter">port</replaceable> are omitted or specified
as <literal>-</literal>, the value of that parameter from the
previous connection is used. If there is no previous
connection, the <application>libpq</application> default for
the parameter's value is used.
</para> </para>
<tip>
<para> <para>
To print your current working directory, use <literal>\! pwd</literal>. If the connection attempt failed (wrong user name, access
denied, etc.), the previous connection will only be kept if
<application>psql</application> is in interactive mode. When
executing a non-interactive script, processing will
immediately stop with an error. This distinction was chosen as
a user convenience against typos on the one hand, and a safety
mechanism that scripts are not accidentally acting on the
wrong database on the other hand.
</para> </para>
</tip>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -762,32 +775,19 @@ testdb=&gt; ...@@ -762,32 +775,19 @@ testdb=&gt;
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><literal>\connect</literal> (or <literal>\c</literal>) <literal>[ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ]</literal></term> <term><literal>\cd [ <replaceable>directory</replaceable> ]</literal></term>
<listitem> <listitem>
<para> <para>
Establishes a new connection to a <productname>PostgreSQL</> Changes the current working directory to
server. If the new connection is successfully made, the <replaceable>directory</replaceable>. Without argument, changes
previous connection is closed. If any of <replaceable to the current user's home directory.
class="parameter">dbname</replaceable>, <replaceable
class="parameter">username</replaceable>, <replaceable
class="parameter">host</replaceable> or <replaceable
class="parameter">port</replaceable> are omitted or specified
as <literal>-</literal>, the value of that parameter from the
previous connection is used. If there is no previous
connection, the <application>libpq</application> default for
the parameter's value is used.
</para> </para>
<tip>
<para> <para>
If the connection attempt failed (wrong user name, access To print your current working directory, use <literal>\! pwd</literal>.
denied, etc.), the previous connection will only be kept if
<application>psql</application> is in interactive mode. When
executing a non-interactive script, processing will
immediately stop with an error. This distinction was chosen as
a user convenience against typos on the one hand, and a safety
mechanism that scripts are not accidentally acting on the
wrong database on the other hand.
</para> </para>
</tip>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -1049,14 +1049,30 @@ testdb=&gt; ...@@ -1049,14 +1049,30 @@ testdb=&gt;
<varlistentry> <varlistentry>
<term><literal>\det[+] [ <link linkend="APP-PSQL-patterns"><replaceable class="parameter">pattern</replaceable></link> ]</literal></term> <term><literal>\dE[S+] [ <link linkend="APP-PSQL-patterns"><replaceable class="parameter">pattern</replaceable></link> ]</literal></term>
<term><literal>\di[S+] [ <link linkend="APP-PSQL-patterns"><replaceable class="parameter">pattern</replaceable></link> ]</literal></term>
<term><literal>\ds[S+] [ <link linkend="APP-PSQL-patterns"><replaceable class="parameter">pattern</replaceable></link> ]</literal></term>
<term><literal>\dt[S+] [ <link linkend="APP-PSQL-patterns"><replaceable class="parameter">pattern</replaceable></link> ]</literal></term>
<term><literal>\dv[S+] [ <link linkend="APP-PSQL-patterns"><replaceable class="parameter">pattern</replaceable></link> ]</literal></term>
<listitem> <listitem>
<para> <para>
Lists foreign tables (mnemonic: <quote>external tables</quote>). In this group of commands, the letters <literal>E</literal>,
<literal>i</literal>, <literal>s</literal>,
<literal>t</literal>, and <literal>v</literal>
stand for foreign table, index, sequence, table, and view,
respectively.
You can specify any or all of
these letters, in any order, to obtain a listing of objects
of these types. For example, <literal>\dit</> lists indexes
and tables. If <literal>+</literal> is
appended to the command name, each object is listed with its
physical size on disk and its associated description, if any.
If <replaceable class="parameter">pattern</replaceable> is If <replaceable class="parameter">pattern</replaceable> is
specified, only entries whose table name or schema name matches specified, only objects whose names match the pattern are listed.
the pattern are listed. If the form <literal>\det+</literal> By default, only user-created objects are shown; supply a
is used, generic options are also displayed. pattern or the <literal>S</literal> modifier to include system
objects.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -1078,6 +1094,20 @@ testdb=&gt; ...@@ -1078,6 +1094,20 @@ testdb=&gt;
</varlistentry> </varlistentry>
<varlistentry>
<term><literal>\det[+] [ <link linkend="APP-PSQL-patterns"><replaceable class="parameter">pattern</replaceable></link> ]</literal></term>
<listitem>
<para>
Lists foreign tables (mnemonic: <quote>external tables</quote>).
If <replaceable class="parameter">pattern</replaceable> is
specified, only entries whose table name or schema name matches
the pattern are listed. If the form <literal>\det+</literal>
is used, generic options are also displayed.
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><literal>\deu[+] [ <link linkend="APP-PSQL-patterns"><replaceable class="parameter">pattern</replaceable></link> ]</literal></term> <term><literal>\deu[+] [ <link linkend="APP-PSQL-patterns"><replaceable class="parameter">pattern</replaceable></link> ]</literal></term>
<listitem> <listitem>
...@@ -1220,36 +1250,6 @@ testdb=&gt; ...@@ -1220,36 +1250,6 @@ testdb=&gt;
</varlistentry> </varlistentry>
<varlistentry>
<term><literal>\di[S+] [ <link linkend="APP-PSQL-patterns"><replaceable class="parameter">pattern</replaceable></link> ]</literal></term>
<term><literal>\ds[S+] [ <link linkend="APP-PSQL-patterns"><replaceable class="parameter">pattern</replaceable></link> ]</literal></term>
<term><literal>\dt[S+] [ <link linkend="APP-PSQL-patterns"><replaceable class="parameter">pattern</replaceable></link> ]</literal></term>
<term><literal>\dv[S+] [ <link linkend="APP-PSQL-patterns"><replaceable class="parameter">pattern</replaceable></link> ]</literal></term>
<term><literal>\dE[S+] [ <link linkend="APP-PSQL-patterns"><replaceable class="parameter">pattern</replaceable></link> ]</literal></term>
<listitem>
<para>
In this group of commands, the letters
<literal>i</literal>, <literal>s</literal>,
<literal>t</literal>, <literal>v</literal>, and <literal>E</literal>
stand for index, sequence, table, view, and foreign table,
respectively.
You can specify any or all of
these letters, in any order, to obtain a listing of objects
of these types. For example, <literal>\dit</> lists indexes
and tables. If <literal>+</literal> is
appended to the command name, each object is listed with its
physical size on disk and its associated description, if any.
If <replaceable class="parameter">pattern</replaceable> is
specified, only objects whose names match the pattern are listed.
By default, only user-created objects are shown; supply a
pattern or the <literal>S</literal> modifier to include system
objects.
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><literal>\dl</literal></term> <term><literal>\dl</literal></term>
<listitem> <listitem>
...@@ -1417,7 +1417,7 @@ testdb=&gt; ...@@ -1417,7 +1417,7 @@ testdb=&gt;
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><literal>\edit</> (or <literal>\e</>) <literal> <optional> <replaceable class="parameter">filename</> </optional> <optional> <replaceable class="parameter">line_number</> </optional> </literal></term> <term><literal>\e</literal> or <literal>\edit</> <literal> <optional> <replaceable class="parameter">filename</> </optional> <optional> <replaceable class="parameter">line_number</> </optional> </literal></term>
<listitem> <listitem>
<para> <para>
...@@ -1462,6 +1462,30 @@ testdb=&gt; ...@@ -1462,6 +1462,30 @@ testdb=&gt;
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><literal>\echo <replaceable class="parameter">text</replaceable> [ ... ]</literal></term>
<listitem>
<para>
Prints the arguments to the standard output, separated by one
space and followed by a newline. This can be useful to
intersperse information in the output of scripts. For example:
<programlisting>
=&gt; <userinput>\echo `date`</userinput>
Tue Oct 26 21:40:57 CEST 1999
</programlisting>
If the first argument is an unquoted <literal>-n</literal> the trailing
newline is not written.
</para>
<tip>
<para>
If you use the <command>\o</command> command to redirect your
query output you might wish to use <command>\qecho</command>
instead of this command.
</para>
</tip>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><literal>\ef <optional> <replaceable class="parameter">function_description</> <optional> <replaceable class="parameter">line_number</> </optional> </optional> </literal></term> <term><literal>\ef <optional> <replaceable class="parameter">function_description</> <optional> <replaceable class="parameter">line_number</> </optional> </optional> </literal></term>
...@@ -1501,32 +1525,6 @@ testdb=&gt; ...@@ -1501,32 +1525,6 @@ testdb=&gt;
</varlistentry> </varlistentry>
<varlistentry>
<term><literal>\echo <replaceable class="parameter">text</replaceable> [ ... ]</literal></term>
<listitem>
<para>
Prints the arguments to the standard output, separated by one
space and followed by a newline. This can be useful to
intersperse information in the output of scripts. For example:
<programlisting>
=&gt; <userinput>\echo `date`</userinput>
Tue Oct 26 21:40:57 CEST 1999
</programlisting>
If the first argument is an unquoted <literal>-n</literal> the trailing
newline is not written.
</para>
<tip>
<para>
If you use the <command>\o</command> command to redirect your
query output you might wish to use <command>\qecho</command>
instead of this command.
</para>
</tip>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><literal>\encoding [ <replaceable class="parameter">encoding</replaceable> ]</literal></term> <term><literal>\encoding [ <replaceable class="parameter">encoding</replaceable> ]</literal></term>
...@@ -1571,7 +1569,7 @@ Tue Oct 26 21:40:57 CEST 1999 ...@@ -1571,7 +1569,7 @@ Tue Oct 26 21:40:57 CEST 1999
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><literal>\help</literal> (or <literal>\h</literal>) <literal>[ <replaceable class="parameter">command</replaceable> ]</literal></term> <term><literal>\h</literal> or <literal>\help</literal> <literal>[ <replaceable class="parameter">command</replaceable> ]</literal></term>
<listitem> <listitem>
<para> <para>
Gives syntax help on the specified <acronym>SQL</acronym> Gives syntax help on the specified <acronym>SQL</acronym>
...@@ -1817,6 +1815,85 @@ lo_import 152801 ...@@ -1817,6 +1815,85 @@ lo_import 152801
<para> <para>
Adjustable printing options are: Adjustable printing options are:
<variablelist> <variablelist>
<varlistentry>
<term><literal>border</literal></term>
<listitem>
<para>
The <replaceable class="parameter">value</replaceable> must be a
number. In general, the higher
the number the more borders and lines the tables will have,
but this depends on the particular format. In
<acronym>HTML</acronym> format, this will translate directly
into the <literal>border=...</literal> attribute; in the
other formats only values 0 (no border), 1 (internal dividing lines),
and 2 (table frame) make sense.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>columns</literal></term>
<listitem>
<para>
Sets the target width for the <literal>wrapped</> format, and also
the width limit for determining whether output is wide enough to
require the pager.
Zero (the default) causes the target width to be controlled by the
environment variable <envar>COLUMNS</>, or the detected screen width
if <envar>COLUMNS</> is not set.
In addition, if <literal>columns</> is zero then the
<literal>wrapped</> format only affects screen output.
If <literal>columns</> is nonzero then file and pipe output is
wrapped to that width as well.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>expanded</literal> (or <literal>x</literal>)</term>
<listitem>
<para>
If <replaceable class="parameter">value</replaceable> is specified
it must be either <literal>on</literal> or <literal>off</literal>
which will enable or disable expanded mode. If <replaceable
class="parameter">value</replaceable> is omitted the command toggles
between regular and expanded mode.
When expanded mode is enabled, query results
are displayed in two columns, with the column name on the left and
the data on the right. This mode is useful if the data wouldn't fit
on the screen in the normal <quote>horizontal</quote> mode.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>fieldsep</literal></term>
<listitem>
<para>
Specifies the field separator to be used in unaligned output
format. That way one can create, for example, tab- or
comma-separated output, which other programs might prefer. To
set a tab as field separator, type <literal>\pset fieldsep
'\t'</literal>. The default field separator is
<literal>'|'</literal> (a vertical bar).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>footer</literal></term>
<listitem>
<para>
If <replaceable class="parameter">value</replaceable> is specified
it must be either <literal>on</literal> or <literal>off</literal>
which will enable or disable display of the table footer
(the <literal>(<replaceable>n</> rows)</literal> count).
If <replaceable class="parameter">value</replaceable> is omitted the
command toggles footer display on or off.
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><literal>format</literal></term> <term><literal>format</literal></term>
<listitem> <listitem>
...@@ -1863,40 +1940,6 @@ lo_import 152801 ...@@ -1863,40 +1940,6 @@ lo_import 152801
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><literal>columns</literal></term>
<listitem>
<para>
Sets the target width for the <literal>wrapped</> format, and also
the width limit for determining whether output is wide enough to
require the pager.
Zero (the default) causes the target width to be controlled by the
environment variable <envar>COLUMNS</>, or the detected screen width
if <envar>COLUMNS</> is not set.
In addition, if <literal>columns</> is zero then the
<literal>wrapped</> format only affects screen output.
If <literal>columns</> is nonzero then file and pipe output is
wrapped to that width as well.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>border</literal></term>
<listitem>
<para>
The <replaceable class="parameter">value</replaceable> must be a
number. In general, the higher
the number the more borders and lines the tables will have,
but this depends on the particular format. In
<acronym>HTML</acronym> format, this will translate directly
into the <literal>border=...</literal> attribute; in the
other formats only values 0 (no border), 1 (internal dividing lines),
and 2 (table frame) make sense.
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><literal>linestyle</literal></term> <term><literal>linestyle</literal></term>
<listitem> <listitem>
...@@ -1951,23 +1994,6 @@ lo_import 152801 ...@@ -1951,23 +1994,6 @@ lo_import 152801
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><literal>expanded</literal> (or <literal>x</literal>)</term>
<listitem>
<para>
If <replaceable class="parameter">value</replaceable> is specified
it must be either <literal>on</literal> or <literal>off</literal>
which will enable or disable expanded mode. If <replaceable
class="parameter">value</replaceable> is omitted the command toggles
between regular and expanded mode.
When expanded mode is enabled, query results
are displayed in two columns, with the column name on the left and
the data on the right. This mode is useful if the data wouldn't fit
on the screen in the normal <quote>horizontal</quote> mode.
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><literal>null</literal></term> <term><literal>null</literal></term>
<listitem> <listitem>
...@@ -1980,34 +2006,6 @@ lo_import 152801 ...@@ -1980,34 +2006,6 @@ lo_import 152801
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><literal>fieldsep</literal></term>
<listitem>
<para>
Specifies the field separator to be used in unaligned output
format. That way one can create, for example, tab- or
comma-separated output, which other programs might prefer. To
set a tab as field separator, type <literal>\pset fieldsep
'\t'</literal>. The default field separator is
<literal>'|'</literal> (a vertical bar).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>footer</literal></term>
<listitem>
<para>
If <replaceable class="parameter">value</replaceable> is specified
it must be either <literal>on</literal> or <literal>off</literal>
which will enable or disable display of the table footer
(the <literal>(<replaceable>n</> rows)</literal> count).
If <replaceable class="parameter">value</replaceable> is omitted the
command toggles footer display on or off.
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><literal>numericlocale</literal></term> <term><literal>numericlocale</literal></term>
<listitem> <listitem>
...@@ -2023,39 +2021,36 @@ lo_import 152801 ...@@ -2023,39 +2021,36 @@ lo_import 152801
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><literal>recordsep</literal></term> <term><literal>pager</literal></term>
<listitem> <listitem>
<para> <para>
Specifies the record (line) separator to use in unaligned Controls use of a pager program for query and <application>psql</>
output format. The default is a newline character. help output. If the environment variable <envar>PAGER</envar>
is set, the output is piped to the specified program.
Otherwise a platform-dependent default (such as
<filename>more</filename>) is used.
</para> </para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>tuples_only</literal> (or <literal>t</literal>)</term>
<listitem>
<para> <para>
If <replaceable class="parameter">value</replaceable> is specified When the <literal>pager</> option is <literal>off</>, the pager
it must be either <literal>on</literal> or <literal>off</literal> program is not used. When the <literal>pager</> option is
which will enable or disable tuples-only mode. <literal>on</>, the pager is used when appropriate, i.e., when the
If <replaceable class="parameter">value</replaceable> is omitted the output is to a terminal and will not fit on the screen.
command toggles between regular and tuples-only output. The <literal>pager</> option can also be set to <literal>always</>,
Regular output includes extra information such which causes the pager to be used for all terminal output regardless
as column headers, titles, and various footers. In tuples-only of whether it fits on the screen. <literal>\pset pager</>
mode, only actual table data is shown. without a <replaceable class="parameter">value</replaceable>
toggles pager use on and off.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><literal>title</literal></term> <term><literal>recordsep</literal></term>
<listitem> <listitem>
<para> <para>
Sets the table title for any subsequently printed tables. This Specifies the record (line) separator to use in unaligned
can be used to give your output descriptive tags. If no output format. The default is a newline character.
<replaceable class="parameter">value</replaceable> is given,
the title is unset.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -2079,26 +2074,29 @@ lo_import 152801 ...@@ -2079,26 +2074,29 @@ lo_import 152801
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><literal>pager</literal></term> <term><literal>title</literal></term>
<listitem> <listitem>
<para> <para>
Controls use of a pager program for query and <application>psql</> Sets the table title for any subsequently printed tables. This
help output. If the environment variable <envar>PAGER</envar> can be used to give your output descriptive tags. If no
is set, the output is piped to the specified program. <replaceable class="parameter">value</replaceable> is given,
Otherwise a platform-dependent default (such as the title is unset.
<filename>more</filename>) is used.
</para> </para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>tuples_only</literal> (or <literal>t</literal>)</term>
<listitem>
<para> <para>
When the <literal>pager</> option is <literal>off</>, the pager If <replaceable class="parameter">value</replaceable> is specified
program is not used. When the <literal>pager</> option is it must be either <literal>on</literal> or <literal>off</literal>
<literal>on</>, the pager is used when appropriate, i.e., when the which will enable or disable tuples-only mode.
output is to a terminal and will not fit on the screen. If <replaceable class="parameter">value</replaceable> is omitted the
The <literal>pager</> option can also be set to <literal>always</>, command toggles between regular and tuples-only output.
which causes the pager to be used for all terminal output regardless Regular output includes extra information such
of whether it fits on the screen. <literal>\pset pager</> as column headers, titles, and various footers. In tuples-only
without a <replaceable class="parameter">value</replaceable> mode, only actual table data is shown.
toggles pager use on and off.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment