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=>
</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>
<para>
Changes the current working directory to
<replaceable>directory</replaceable>. Without argument, changes
to the current user's home directory.
Establishes a new connection to a <productname>PostgreSQL</>
server. If the new connection is successfully made, the
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>
<tip>
<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>
</tip>
</listitem>
</varlistentry>
......@@ -762,32 +775,19 @@ testdb=&gt;
</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>
<para>
Establishes a new connection to a <productname>PostgreSQL</>
server. If the new connection is successfully made, the
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.
Changes the current working directory to
<replaceable>directory</replaceable>. Without argument, changes
to the current user's home directory.
</para>
<tip>
<para>
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.
To print your current working directory, use <literal>\! pwd</literal>.
</para>
</tip>
</listitem>
</varlistentry>
......@@ -1049,14 +1049,30 @@ testdb=&gt;
<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>
<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
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.
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>
......@@ -1078,6 +1094,20 @@ testdb=&gt;
</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>
<term><literal>\deu[+] [ <link linkend="APP-PSQL-patterns"><replaceable class="parameter">pattern</replaceable></link> ]</literal></term>
<listitem>
......@@ -1220,36 +1250,6 @@ testdb=&gt;
</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>
<term><literal>\dl</literal></term>
<listitem>
......@@ -1417,7 +1417,7 @@ testdb=&gt;
</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>
<para>
......@@ -1462,6 +1462,30 @@ testdb=&gt;
</listitem>
</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>
<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;
</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>
<term><literal>\encoding [ <replaceable class="parameter">encoding</replaceable> ]</literal></term>
......@@ -1571,7 +1569,7 @@ Tue Oct 26 21:40:57 CEST 1999
</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>
<para>
Gives syntax help on the specified <acronym>SQL</acronym>
......@@ -1817,6 +1815,85 @@ lo_import 152801
<para>
Adjustable printing options are:
<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>
<term><literal>format</literal></term>
<listitem>
......@@ -1863,40 +1940,6 @@ lo_import 152801
</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>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>linestyle</literal></term>
<listitem>
......@@ -1951,23 +1994,6 @@ lo_import 152801
</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>null</literal></term>
<listitem>
......@@ -1980,34 +2006,6 @@ lo_import 152801
</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>
<term><literal>numericlocale</literal></term>
<listitem>
......@@ -2023,39 +2021,36 @@ lo_import 152801
</varlistentry>
<varlistentry>
<term><literal>recordsep</literal></term>
<term><literal>pager</literal></term>
<listitem>
<para>
Specifies the record (line) separator to use in unaligned
output format. The default is a newline character.
Controls use of a pager program for query and <application>psql</>
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>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>tuples_only</literal> (or <literal>t</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 tuples-only mode.
If <replaceable class="parameter">value</replaceable> is omitted the
command toggles between regular and tuples-only output.
Regular output includes extra information such
as column headers, titles, and various footers. In tuples-only
mode, only actual table data is shown.
When the <literal>pager</> option is <literal>off</>, the pager
program is not used. When the <literal>pager</> option is
<literal>on</>, the pager is used when appropriate, i.e., when the
output is to a terminal and will not fit on the screen.
The <literal>pager</> option can also be set to <literal>always</>,
which causes the pager to be used for all terminal output regardless
of whether it fits on the screen. <literal>\pset pager</>
without a <replaceable class="parameter">value</replaceable>
toggles pager use on and off.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>title</literal></term>
<term><literal>recordsep</literal></term>
<listitem>
<para>
Sets the table title for any subsequently printed tables. This
can be used to give your output descriptive tags. If no
<replaceable class="parameter">value</replaceable> is given,
the title is unset.
Specifies the record (line) separator to use in unaligned
output format. The default is a newline character.
</para>
</listitem>
</varlistentry>
......@@ -2079,26 +2074,29 @@ lo_import 152801
</varlistentry>
<varlistentry>
<term><literal>pager</literal></term>
<term><literal>title</literal></term>
<listitem>
<para>
Controls use of a pager program for query and <application>psql</>
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.
Sets the table title for any subsequently printed tables. This
can be used to give your output descriptive tags. If no
<replaceable class="parameter">value</replaceable> is given,
the title is unset.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>tuples_only</literal> (or <literal>t</literal>)</term>
<listitem>
<para>
When the <literal>pager</> option is <literal>off</>, the pager
program is not used. When the <literal>pager</> option is
<literal>on</>, the pager is used when appropriate, i.e., when the
output is to a terminal and will not fit on the screen.
The <literal>pager</> option can also be set to <literal>always</>,
which causes the pager to be used for all terminal output regardless
of whether it fits on the screen. <literal>\pset pager</>
without a <replaceable class="parameter">value</replaceable>
toggles pager use on and off.
If <replaceable class="parameter">value</replaceable> is specified
it must be either <literal>on</literal> or <literal>off</literal>
which will enable or disable tuples-only mode.
If <replaceable class="parameter">value</replaceable> is omitted the
command toggles between regular and tuples-only output.
Regular output includes extra information such
as column headers, titles, and various footers. In tuples-only
mode, only actual table data is shown.
</para>
</listitem>
</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