mirror of
https://github.com/postgres/postgres.git
synced 2025-06-01 00:01:20 -04:00
More minor updates and copy-editing.
This commit is contained in:
parent
248d92ddf4
commit
cc093bc3ad
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$PostgreSQL: pgsql/doc/src/sgml/ref/ipcclean.sgml,v 1.10 2003/11/29 19:51:39 pgsql Exp $
|
$PostgreSQL: pgsql/doc/src/sgml/ref/ipcclean.sgml,v 1.11 2005/01/04 03:58:16 tgl Exp $
|
||||||
PostgreSQL documentation
|
PostgreSQL documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ PostgreSQL documentation
|
|||||||
|
|
||||||
<refnamediv>
|
<refnamediv>
|
||||||
<refname>ipcclean</refname>
|
<refname>ipcclean</refname>
|
||||||
<refpurpose>remove shared memory and semaphores from an aborted <productname>PostgreSQL</productname> server</refpurpose>
|
<refpurpose>remove shared memory and semaphores from a failed <productname>PostgreSQL</productname> server</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
|
|
||||||
<indexterm zone="app-ipcclean">
|
<indexterm zone="app-ipcclean">
|
||||||
@ -59,10 +59,11 @@ PostgreSQL documentation
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The script makes assumption about the format of output of the
|
The script makes assumptions about the output format of the
|
||||||
<command>ipcs</command>
|
<command>ipcs</command>
|
||||||
utility which may not be true across different operating systems.
|
utility which may not be true across different operating systems.
|
||||||
Therefore, it may not work on your particular OS.
|
Therefore, it may not work on your particular OS. It's wise to
|
||||||
|
look at the script before trying it.
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/ref/pg_config-ref.sgml,v 1.18 2004/08/02 12:34:14 momjian Exp $ -->
|
<!-- $PostgreSQL: pgsql/doc/src/sgml/ref/pg_config-ref.sgml,v 1.19 2005/01/04 03:58:16 tgl Exp $ -->
|
||||||
|
|
||||||
<refentry id="app-pgconfig">
|
<refentry id="app-pgconfig">
|
||||||
<refmeta>
|
<refmeta>
|
||||||
@ -153,7 +153,7 @@
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
In releases prior to <productname>PostgreSQL</> 7.1, before the
|
In releases prior to <productname>PostgreSQL</> 7.1, before
|
||||||
<command>pg_config</command> came to be, a method for finding the
|
<command>pg_config</command> came to be, a method for finding the
|
||||||
equivalent configuration information did not exist.
|
equivalent configuration information did not exist.
|
||||||
</para>
|
</para>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$PostgreSQL: pgsql/doc/src/sgml/ref/pg_dump.sgml,v 1.74 2004/10/21 22:48:54 tgl Exp $
|
$PostgreSQL: pgsql/doc/src/sgml/ref/pg_dump.sgml,v 1.75 2005/01/04 03:58:16 tgl Exp $
|
||||||
PostgreSQL documentation
|
PostgreSQL documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
@ -45,21 +45,24 @@ PostgreSQL documentation
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Dumps can be output in script or archive file formats. The script
|
Dumps can be output in script or archive file formats. Script
|
||||||
files are in plain-text format and contain the SQL commands required
|
dumps are plain-text files containing the SQL commands required
|
||||||
to reconstruct the database to the state it was in at the time it was
|
to reconstruct the database to the state it was in at the time it was
|
||||||
saved. To restore these scripts, use <xref linkend="app-psql">. They
|
saved. To restore from such a script, feed it to <xref
|
||||||
|
linkend="app-psql">. Script files
|
||||||
can be used to reconstruct the database even on other machines and
|
can be used to reconstruct the database even on other machines and
|
||||||
other architectures, with some modifications even on other SQL
|
other architectures; with some modifications even on other SQL
|
||||||
database products.
|
database products.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The alternative archive file formats that are meant to be used with
|
The alternative archive file formats must be used with
|
||||||
<xref linkend="app-pgrestore"> to rebuild the database, and they also
|
<xref linkend="app-pgrestore"> to rebuild the database. They
|
||||||
allow <application>pg_restore</application> to be selective about
|
allow <application>pg_restore</application> to be selective about
|
||||||
what is restored, or even to reorder the items prior to being
|
what is restored, or even to reorder the items prior to being
|
||||||
restored. The archive files are also designed to be portable across
|
restored. The archive formats also allow saving and restoring
|
||||||
|
<quote>large objects</>, which is not possible in a script dump.
|
||||||
|
The archive files are also designed to be portable across
|
||||||
architectures.
|
architectures.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -76,7 +79,7 @@ PostgreSQL documentation
|
|||||||
by default. The <application>tar</application> format
|
by default. The <application>tar</application> format
|
||||||
(<option>-Ft</option>) is not compressed and it is not possible to
|
(<option>-Ft</option>) is not compressed and it is not possible to
|
||||||
reorder data when loading, but it is otherwise quite flexible;
|
reorder data when loading, but it is otherwise quite flexible;
|
||||||
moreover, it can be manipulated with other tools such as
|
moreover, it can be manipulated with standard Unix tools such as
|
||||||
<command>tar</command>.
|
<command>tar</command>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -92,17 +95,18 @@ PostgreSQL documentation
|
|||||||
<title>Options</title>
|
<title>Options</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The following command-line options are used to control the output format.
|
The following command-line options control the content and
|
||||||
|
format of the output.
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><replaceable class="parameter">dbname</replaceable></term>
|
<term><replaceable class="parameter">dbname</replaceable></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specifies the name of the database to be dumped. If this is
|
Specifies the name of the database to be dumped. If this is
|
||||||
not specified, the environment variable
|
not specified, the environment variable
|
||||||
<envar>PGDATABASE</envar> is used. If that is not set, the
|
<envar>PGDATABASE</envar> is used. If that is not set, the
|
||||||
user name specified for the connection is used.
|
user name specified for the connection is used.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -112,12 +116,12 @@ PostgreSQL documentation
|
|||||||
<term><option>--data-only</></term>
|
<term><option>--data-only</></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Dump only the data, not the object definitions (schema)
|
Dump only the data, not the schema (data definitions).
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
This option is only meaningful for the plain-text format. For
|
This option is only meaningful for the plain-text format. For
|
||||||
the other formats, you may specify the option when you
|
the archive formats, you may specify the option when you
|
||||||
call <command>pg_restore</command>.
|
call <command>pg_restore</command>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -128,7 +132,8 @@ PostgreSQL documentation
|
|||||||
<term><option>--blobs</></term>
|
<term><option>--blobs</></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Include large objects in dump.
|
Include large objects in the dump. A non-text output format
|
||||||
|
must be selected.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -139,12 +144,12 @@ PostgreSQL documentation
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Output commands to clean (drop)
|
Output commands to clean (drop)
|
||||||
database objects prior to (the commands for) creating them.
|
database objects prior to (the commands for) creating them.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
This option is only meaningful for the plain-text format. For
|
This option is only meaningful for the plain-text format. For
|
||||||
the other formats, you may specify the option when you
|
the archive formats, you may specify the option when you
|
||||||
call <command>pg_restore</command>.
|
call <command>pg_restore</command>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -155,15 +160,15 @@ PostgreSQL documentation
|
|||||||
<term><option>--create</></term>
|
<term><option>--create</></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Begin the output with a command to create the
|
Begin the output with a command to create the
|
||||||
database itself and reconnect to the created database. (With a
|
database itself and reconnect to the created database. (With a
|
||||||
script of this form, it doesn't matter which database you connect
|
script of this form, it doesn't matter which database you connect
|
||||||
to before running the script.)
|
to before running the script.)
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
This option is only meaningful for the plain-text format. For
|
This option is only meaningful for the plain-text format. For
|
||||||
the other formats, you may specify the option when you
|
the archive formats, you may specify the option when you
|
||||||
call <command>pg_restore</command>.
|
call <command>pg_restore</command>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -174,12 +179,12 @@ PostgreSQL documentation
|
|||||||
<term><option>--inserts</option></term>
|
<term><option>--inserts</option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Dump data as <command>INSERT</command> commands (rather
|
Dump data as <command>INSERT</command> commands (rather
|
||||||
than <command>COPY</command>). This will make restoration very slow;
|
than <command>COPY</command>). This will make restoration very slow;
|
||||||
it is mainly useful for making dumps that can be loaded into
|
it is mainly useful for making dumps that can be loaded into
|
||||||
non-<productname>PostgreSQL</productname> databases. Note that
|
non-<productname>PostgreSQL</productname> databases. Note that
|
||||||
the restore may fail altogether if you have rearranged column order.
|
the restore may fail altogether if you have rearranged column order.
|
||||||
The <option>-D</option> option is safer, though even slower.
|
The <option>-D</option> option is safer, though even slower.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -190,13 +195,13 @@ PostgreSQL documentation
|
|||||||
<term><option>--attribute-inserts</option></term>
|
<term><option>--attribute-inserts</option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Dump data as <command>INSERT</command> commands with explicit
|
Dump data as <command>INSERT</command> commands with explicit
|
||||||
column names (<literal>INSERT INTO
|
column names (<literal>INSERT INTO
|
||||||
<replaceable>table</replaceable>
|
<replaceable>table</replaceable>
|
||||||
(<replaceable>column</replaceable>, ...) VALUES
|
(<replaceable>column</replaceable>, ...) VALUES
|
||||||
...</literal>). This will make restoration very slow; it is mainly
|
...</literal>). This will make restoration very slow; it is mainly
|
||||||
useful for making dumps that can be loaded into
|
useful for making dumps that can be loaded into
|
||||||
non-<productname>PostgreSQL</productname> databases.
|
non-<productname>PostgreSQL</productname> databases.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -206,8 +211,8 @@ PostgreSQL documentation
|
|||||||
<term><option>--file=<replaceable class="parameter">file</replaceable></option></term>
|
<term><option>--file=<replaceable class="parameter">file</replaceable></option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Send output to the specified file. If this is omitted, the
|
Send output to the specified file. If this is omitted, the
|
||||||
standard output is used.
|
standard output is used.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -218,7 +223,7 @@ PostgreSQL documentation
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Selects the format of the output.
|
Selects the format of the output.
|
||||||
<replaceable>format</replaceable> can be one of the following:
|
<replaceable>format</replaceable> can be one of the following:
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
@ -295,7 +300,7 @@ PostgreSQL documentation
|
|||||||
<para>
|
<para>
|
||||||
In this mode, <application>pg_dump</application> makes no
|
In this mode, <application>pg_dump</application> makes no
|
||||||
attempt to dump any other database objects that objects in the
|
attempt to dump any other database objects that objects in the
|
||||||
selected schema may depend upon. Therefore, there is no
|
selected schema may depend upon. Therefore, there is no
|
||||||
guarantee that the results of a single-schema dump can be
|
guarantee that the results of a single-schema dump can be
|
||||||
successfully restored by themselves into a clean database.
|
successfully restored by themselves into a clean database.
|
||||||
</para>
|
</para>
|
||||||
@ -308,10 +313,11 @@ PostgreSQL documentation
|
|||||||
<term><option>--oids</></term>
|
<term><option>--oids</></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Dump object identifiers (<acronym>OID</acronym>s) for every
|
Dump object identifiers (<acronym>OID</acronym>s) as part of the
|
||||||
table. Use this option if your application references the <acronym>OID</>
|
data for every table. Use this option if your application references
|
||||||
columns in some way (e.g., in a foreign key constraint).
|
the <acronym>OID</>
|
||||||
Otherwise, this option should not be used.
|
columns in some way (e.g., in a foreign key constraint).
|
||||||
|
Otherwise, this option should not be used.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -322,20 +328,21 @@ PostgreSQL documentation
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Do not output commands to set
|
Do not output commands to set
|
||||||
ownership of objects to match the original database.
|
ownership of objects to match the original database.
|
||||||
By default, <application>pg_dump</application> issues
|
By default, <application>pg_dump</application> issues
|
||||||
<command>SET SESSION AUTHORIZATION</command>
|
<command>ALTER OWNER</> or
|
||||||
statements to set ownership of created database objects.
|
<command>SET SESSION AUTHORIZATION</command>
|
||||||
These statements
|
statements to set ownership of created database objects.
|
||||||
will fail when the script is run unless it is started by a superuser
|
These statements
|
||||||
(or the same user that owns all of the objects in the script).
|
will fail when the script is run unless it is started by a superuser
|
||||||
To make a script that can be restored by any user, but will give
|
(or the same user that owns all of the objects in the script).
|
||||||
that user ownership of all the objects, specify <option>-O</>.
|
To make a script that can be restored by any user, but will give
|
||||||
|
that user ownership of all the objects, specify <option>-O</>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
This option is only meaningful for the plain-text format. For
|
This option is only meaningful for the plain-text format. For
|
||||||
the other formats, you may specify the option when you
|
the archive formats, you may specify the option when you
|
||||||
call <command>pg_restore</command>.
|
call <command>pg_restore</command>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -347,7 +354,7 @@ PostgreSQL documentation
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
This option is obsolete but still accepted for backwards
|
This option is obsolete but still accepted for backwards
|
||||||
compatibility.
|
compatibility.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -357,7 +364,7 @@ PostgreSQL documentation
|
|||||||
<term><option>--schema-only</option></term>
|
<term><option>--schema-only</option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Dump only the object definitions (schema), not data.
|
Dump only the object definitions (schema), not data.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -368,9 +375,9 @@ PostgreSQL documentation
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specify the superuser user name to use when disabling triggers.
|
Specify the superuser user name to use when disabling triggers.
|
||||||
This is only relevant if <option>--disable-triggers</> is used.
|
This is only relevant if <option>--disable-triggers</> is used.
|
||||||
(Usually, it's better to leave this out, and instead start the
|
(Usually, it's better to leave this out, and instead start the
|
||||||
resulting script as superuser.)
|
resulting script as superuser.)
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -380,18 +387,18 @@ PostgreSQL documentation
|
|||||||
<term><option>--table=<replaceable class="parameter">table</replaceable></option></term>
|
<term><option>--table=<replaceable class="parameter">table</replaceable></option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Dump data for <replaceable class="parameter">table</replaceable>
|
Dump data for <replaceable class="parameter">table</replaceable>
|
||||||
only. It is possible for there to be
|
only. It is possible for there to be
|
||||||
multiple tables with the same name in different schemas; if that
|
multiple tables with the same name in different schemas; if that
|
||||||
is the case, all matching tables will be dumped. Specify both
|
is the case, all matching tables will be dumped. Specify both
|
||||||
<option>--schema</> and <option>--table</> to select just one table.
|
<option>--schema</> and <option>--table</> to select just one table.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<note>
|
<note>
|
||||||
<para>
|
<para>
|
||||||
In this mode, <application>pg_dump</application> makes no
|
In this mode, <application>pg_dump</application> makes no
|
||||||
attempt to dump any other database objects that the selected table
|
attempt to dump any other database objects that the selected table
|
||||||
may depend upon. Therefore, there is no guarantee
|
may depend upon. Therefore, there is no guarantee
|
||||||
that the results of a single-table dump can be successfully
|
that the results of a single-table dump can be successfully
|
||||||
restored by themselves into a clean database.
|
restored by themselves into a clean database.
|
||||||
</para>
|
</para>
|
||||||
@ -404,8 +411,8 @@ PostgreSQL documentation
|
|||||||
<term><option>--verbose</></term>
|
<term><option>--verbose</></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specifies verbose mode. This will cause
|
Specifies verbose mode. This will cause
|
||||||
<application>pg_dump</application> to output detailed object
|
<application>pg_dump</application> to output detailed object
|
||||||
comments and start/stop times to the dump file, and progress
|
comments and start/stop times to the dump file, and progress
|
||||||
messages to standard error.
|
messages to standard error.
|
||||||
</para>
|
</para>
|
||||||
@ -418,7 +425,7 @@ PostgreSQL documentation
|
|||||||
<term><option>--no-acl</></term>
|
<term><option>--no-acl</></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Prevent dumping of access privileges (grant/revoke commands).
|
Prevent dumping of access privileges (grant/revoke commands).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -456,7 +463,7 @@ PostgreSQL documentation
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
This option is only meaningful for the plain-text format. For
|
This option is only meaningful for the plain-text format. For
|
||||||
the other formats, you may specify the option when you
|
the archive formats, you may specify the option when you
|
||||||
call <command>pg_restore</command>.
|
call <command>pg_restore</command>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -467,10 +474,10 @@ PostgreSQL documentation
|
|||||||
<term><option>--use-set-session-authorization</></term>
|
<term><option>--use-set-session-authorization</></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Output SQL standard SET SESSION AUTHORIZATION commands instead
|
Output SQL standard SET SESSION AUTHORIZATION commands instead
|
||||||
of OWNER TO commands. This makes the dump more standards compatible,
|
of OWNER TO commands. This makes the dump more standards compatible,
|
||||||
but depending on the history of the objects in the dump, may not
|
but depending on the history of the objects in the dump, may not
|
||||||
restore properly.
|
restore properly.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -512,10 +519,10 @@ PostgreSQL documentation
|
|||||||
<term><option>--port=<replaceable class="parameter">port</replaceable></option></term>
|
<term><option>--port=<replaceable class="parameter">port</replaceable></option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specifies the TCP port or local Unix domain socket file
|
Specifies the TCP port or local Unix domain socket file
|
||||||
extension on which the server is listening for connections.
|
extension on which the server is listening for connections.
|
||||||
Defaults to the <envar>PGPORT</envar> environment variable, if
|
Defaults to the <envar>PGPORT</envar> environment variable, if
|
||||||
set, or a compiled-in default.
|
set, or a compiled-in default.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -619,7 +626,7 @@ CREATE DATABASE foo WITH TEMPLATE template0;
|
|||||||
<para>
|
<para>
|
||||||
Members of tar archives are limited to a size less than 8 GB.
|
Members of tar archives are limited to a size less than 8 GB.
|
||||||
(This is an inherent limitation of the tar file format.) Therefore
|
(This is an inherent limitation of the tar file format.) Therefore
|
||||||
this format cannot be used if the textual representation of a table
|
this format cannot be used if the textual representation of any one table
|
||||||
exceeds that size. The total size of a tar archive and any of the
|
exceeds that size. The total size of a tar archive and any of the
|
||||||
other output formats is not limited, except possibly by the
|
other output formats is not limited, except possibly by the
|
||||||
operating system.
|
operating system.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$PostgreSQL: pgsql/doc/src/sgml/ref/pg_dumpall.sgml,v 1.46 2004/07/19 21:39:46 momjian Exp $
|
$PostgreSQL: pgsql/doc/src/sgml/ref/pg_dumpall.sgml,v 1.47 2005/01/04 03:58:16 tgl Exp $
|
||||||
PostgreSQL documentation
|
PostgreSQL documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
@ -68,7 +68,8 @@ PostgreSQL documentation
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
<application>pg_dumpall</application> needs to connect several
|
<application>pg_dumpall</application> needs to connect several
|
||||||
times to the <productname>PostgreSQL</productname> server and might be asking for
|
times to the <productname>PostgreSQL</productname> server (once per
|
||||||
|
database). If you use password authentication it is likely to ask for
|
||||||
a password each time. It is convenient to have a
|
a password each time. It is convenient to have a
|
||||||
<filename>$HOME/.pgpass</> file in such cases.
|
<filename>$HOME/.pgpass</> file in such cases.
|
||||||
</para>
|
</para>
|
||||||
@ -79,7 +80,7 @@ PostgreSQL documentation
|
|||||||
<title>Options</title>
|
<title>Options</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The following command-line options are used to control the content and
|
The following command-line options control the content and
|
||||||
format of the output.
|
format of the output.
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
@ -88,7 +89,7 @@ PostgreSQL documentation
|
|||||||
<term><option>--data-only</></term>
|
<term><option>--data-only</></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Dump only the data, not the schema (data definitions).
|
Dump only the data, not the schema (data definitions).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -98,8 +99,8 @@ PostgreSQL documentation
|
|||||||
<term><option>--clean</option></term>
|
<term><option>--clean</option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Include SQL commands to clean (drop) the databases before
|
Include SQL commands to clean (drop) the databases before
|
||||||
recreating them.
|
recreating them.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -109,10 +110,12 @@ PostgreSQL documentation
|
|||||||
<term><option>--inserts</option></term>
|
<term><option>--inserts</option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Dump data as <command>INSERT</command> commands (rather
|
Dump data as <command>INSERT</command> commands (rather
|
||||||
than <command>COPY</command>). This will make restoration very
|
than <command>COPY</command>). This will make restoration very slow;
|
||||||
slow, but it makes the output more portable to other SQL database
|
it is mainly useful for making dumps that can be loaded into
|
||||||
management systems.
|
non-<productname>PostgreSQL</productname> databases. Note that
|
||||||
|
the restore may fail altogether if you have rearranged column order.
|
||||||
|
The <option>-D</option> option is safer, though even slower.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -123,12 +126,13 @@ PostgreSQL documentation
|
|||||||
<term><option>--attribute-inserts</option></term>
|
<term><option>--attribute-inserts</option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Dump data as <command>INSERT</command> commands with explicit
|
Dump data as <command>INSERT</command> commands with explicit
|
||||||
column names (<literal>INSERT INTO
|
column names (<literal>INSERT INTO
|
||||||
<replaceable>table</replaceable>
|
<replaceable>table</replaceable>
|
||||||
(<replaceable>column</replaceable>, ...) VALUES
|
(<replaceable>column</replaceable>, ...) VALUES
|
||||||
...</literal>). This will make restoration very slow,
|
...</literal>). This will make restoration very slow; it is mainly
|
||||||
but it is necessary if you desire to rearrange column ordering.
|
useful for making dumps that can be loaded into
|
||||||
|
non-<productname>PostgreSQL</productname> databases.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -138,7 +142,7 @@ PostgreSQL documentation
|
|||||||
<term><option>--globals-only</option></term>
|
<term><option>--globals-only</option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Dump only global objects (users and groups), no databases.
|
Dump only global objects (users and groups), no databases.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -168,10 +172,11 @@ PostgreSQL documentation
|
|||||||
<term><option>--oids</></term>
|
<term><option>--oids</></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Dump object identifiers (<acronym>OID</acronym>s) for every
|
Dump object identifiers (<acronym>OID</acronym>s) as part of the
|
||||||
table. Use this option if your application references the OID
|
data for every table. Use this option if your application references
|
||||||
columns in some way (e.g., in a foreign key constraint).
|
the <acronym>OID</>
|
||||||
Otherwise, this option should not be used.
|
columns in some way (e.g., in a foreign key constraint).
|
||||||
|
Otherwise, this option should not be used.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -182,15 +187,16 @@ PostgreSQL documentation
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Do not output commands to set
|
Do not output commands to set
|
||||||
ownership of objects to match the original database.
|
ownership of objects to match the original database.
|
||||||
By default, <application>pg_dumpall</application> issues
|
By default, <application>pg_dumpall</application> issues
|
||||||
<command>SET SESSION AUTHORIZATION</command>
|
<command>ALTER OWNER</> or
|
||||||
statements to set ownership of created schema elements.
|
<command>SET SESSION AUTHORIZATION</command>
|
||||||
These statements
|
statements to set ownership of created schema elements.
|
||||||
will fail when the script is run unless it is started by a superuser
|
These statements
|
||||||
(or the same user that owns all of the objects in the script).
|
will fail when the script is run unless it is started by a superuser
|
||||||
To make a script that can be restored by any user, but will give
|
(or the same user that owns all of the objects in the script).
|
||||||
that user ownership of all the objects, specify <option>-O</>.
|
To make a script that can be restored by any user, but will give
|
||||||
|
that user ownership of all the objects, specify <option>-O</>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -200,7 +206,7 @@ PostgreSQL documentation
|
|||||||
<term><option>--schema-only</option></term>
|
<term><option>--schema-only</option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Dump only the schema (data definitions), no data.
|
Dump only the object definitions (schema), not data.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -211,9 +217,9 @@ PostgreSQL documentation
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specify the superuser user name to use when disabling triggers.
|
Specify the superuser user name to use when disabling triggers.
|
||||||
This is only relevant if <option>--disable-triggers</> is used.
|
This is only relevant if <option>--disable-triggers</> is used.
|
||||||
(Usually, it's better to leave this out, and instead start the
|
(Usually, it's better to leave this out, and instead start the
|
||||||
resulting script as superuser.)
|
resulting script as superuser.)
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -223,8 +229,8 @@ PostgreSQL documentation
|
|||||||
<term><option>--verbose</></term>
|
<term><option>--verbose</></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specifies verbose mode. This will cause
|
Specifies verbose mode. This will cause
|
||||||
<application>pg_dumpall</application> to output start/stop
|
<application>pg_dumpall</application> to output start/stop
|
||||||
times to the dump file, and progress messages to standard error.
|
times to the dump file, and progress messages to standard error.
|
||||||
It will also enable verbose output in <application>pg_dump</>.
|
It will also enable verbose output in <application>pg_dump</>.
|
||||||
</para>
|
</para>
|
||||||
@ -237,7 +243,7 @@ PostgreSQL documentation
|
|||||||
<term><option>--no-acl</></term>
|
<term><option>--no-acl</></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Prevent dumping of access privileges (grant/revoke commands).
|
Prevent dumping of access privileges (grant/revoke commands).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -280,10 +286,10 @@ PostgreSQL documentation
|
|||||||
<term><option>--use-set-session-authorization</></term>
|
<term><option>--use-set-session-authorization</></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Output SQL standard SET SESSION AUTHORIZATION commands instead
|
Output SQL standard SET SESSION AUTHORIZATION commands instead
|
||||||
of OWNER TO commands. This makes the dump more standards compatible,
|
of OWNER TO commands. This makes the dump more standards compatible,
|
||||||
but depending on the history of the objects in the dump, may not
|
but depending on the history of the objects in the dump, may not
|
||||||
restore properly.
|
restore properly.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -299,11 +305,11 @@ PostgreSQL documentation
|
|||||||
<term>-h <replaceable>host</replaceable></term>
|
<term>-h <replaceable>host</replaceable></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specifies the host name of the machine on which the database
|
Specifies the host name of the machine on which the database
|
||||||
server is running. If the value begins with a slash, it is
|
server is running. If the value begins with a slash, it is
|
||||||
used as the directory for the Unix domain socket. The default
|
used as the directory for the Unix domain socket. The default
|
||||||
is taken from the <envar>PGHOST</envar> environment variable,
|
is taken from the <envar>PGHOST</envar> environment variable,
|
||||||
if set, else a Unix domain socket connection is attempted.
|
if set, else a Unix domain socket connection is attempted.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -312,10 +318,10 @@ PostgreSQL documentation
|
|||||||
<term>-p <replaceable>port</replaceable></term>
|
<term>-p <replaceable>port</replaceable></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specifies the TCP port or local Unix domain socket file
|
Specifies the TCP port or local Unix domain socket file
|
||||||
extension on which the server is listening for connections.
|
extension on which the server is listening for connections.
|
||||||
Defaults to the <envar>PGPORT</envar> environment variable, if
|
Defaults to the <envar>PGPORT</envar> environment variable, if
|
||||||
set, or a compiled-in default.
|
set, or a compiled-in default.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/ref/pg_restore.sgml,v 1.48 2004/08/20 04:20:22 momjian Exp $ -->
|
<!-- $PostgreSQL: pgsql/doc/src/sgml/ref/pg_restore.sgml,v 1.49 2005/01/04 03:58:16 tgl Exp $ -->
|
||||||
|
|
||||||
<refentry id="APP-PGRESTORE">
|
<refentry id="APP-PGRESTORE">
|
||||||
<refmeta>
|
<refmeta>
|
||||||
@ -88,7 +88,7 @@
|
|||||||
<term><option>--data-only</option></term>
|
<term><option>--data-only</option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Restore only the data, not the schema (data definitions).
|
Restore only the data, not the schema (data definitions).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -98,7 +98,7 @@
|
|||||||
<term><option>--clean</option></term>
|
<term><option>--clean</option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Clean (drop) database objects before recreating them.
|
Clean (drop) database objects before recreating them.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -158,10 +158,10 @@
|
|||||||
<term><option>--format=<replaceable class="parameter">format</replaceable></option></term>
|
<term><option>--format=<replaceable class="parameter">format</replaceable></option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specify format of the archive. It is not necessary to specify
|
Specify format of the archive. It is not necessary to specify
|
||||||
the format, since <application>pg_restore</application> will
|
the format, since <application>pg_restore</application> will
|
||||||
determine the format automatically. If specified, it can be
|
determine the format automatically. If specified, it can be
|
||||||
one of the following:
|
one of the following:
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
@ -198,7 +198,7 @@
|
|||||||
<term><option>--ignore-version</option></term>
|
<term><option>--ignore-version</option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Ignore database version checks.
|
Ignore database version checks.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -208,7 +208,7 @@
|
|||||||
<term><option>--index=<replaceable class="parameter">index</replaceable></option></term>
|
<term><option>--index=<replaceable class="parameter">index</replaceable></option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Restore definition of named index only.
|
Restore definition of named index only.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -245,15 +245,16 @@
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Do not output commands to set
|
Do not output commands to set
|
||||||
ownership of objects to match the original database.
|
ownership of objects to match the original database.
|
||||||
By default, <application>pg_restore</application> issues
|
By default, <application>pg_restore</application> issues
|
||||||
<command>SET SESSION AUTHORIZATION</command>
|
<command>ALTER OWNER</> or
|
||||||
statements to set ownership of created schema elements.
|
<command>SET SESSION AUTHORIZATION</command>
|
||||||
These statements will fail unless the initial connection to the
|
statements to set ownership of created schema elements.
|
||||||
database is made by a superuser
|
These statements will fail unless the initial connection to the
|
||||||
(or the same user that owns all of the objects in the script).
|
database is made by a superuser
|
||||||
With <option>-O</option>, any user name can be used for the
|
(or the same user that owns all of the objects in the script).
|
||||||
initial connection, and this user will own all the created objects.
|
With <option>-O</option>, any user name can be used for the
|
||||||
|
initial connection, and this user will own all the created objects.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -264,8 +265,8 @@
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Restore the named function only. Be careful to spell the function
|
Restore the named function only. Be careful to spell the function
|
||||||
name and arguments exactly as they appear in the dump file's table
|
name and arguments exactly as they appear in the dump file's table
|
||||||
of contents.
|
of contents.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -276,7 +277,7 @@
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
This option is obsolete but still accepted for backwards
|
This option is obsolete but still accepted for backwards
|
||||||
compatibility.
|
compatibility.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -298,7 +299,7 @@
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specify the superuser user name to use when disabling triggers.
|
Specify the superuser user name to use when disabling triggers.
|
||||||
This is only relevant if <option>--disable-triggers</> is used.
|
This is only relevant if <option>--disable-triggers</> is used.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -328,7 +329,7 @@
|
|||||||
<term><option>--verbose</option></term>
|
<term><option>--verbose</option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specifies verbose mode.
|
Specifies verbose mode.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -339,7 +340,7 @@
|
|||||||
<term><option>--no-acl</option></term>
|
<term><option>--no-acl</option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Prevent restoration of access privileges (grant/revoke commands).
|
Prevent restoration of access privileges (grant/revoke commands).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -349,10 +350,10 @@
|
|||||||
<term><option>--use-set-session-authorization</option></term>
|
<term><option>--use-set-session-authorization</option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Output SQL standard SET SESSION AUTHORIZATION commands instead
|
Output SQL standard SET SESSION AUTHORIZATION commands instead
|
||||||
of OWNER TO commands. This makes the dump more standards compatible,
|
of OWNER TO commands. This makes the dump more standards compatible,
|
||||||
but depending on the history of the objects in the dump, may not
|
but depending on the history of the objects in the dump, may not
|
||||||
restore properly.
|
restore properly.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -363,19 +364,19 @@
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
This option is only relevant when performing a data-only restore.
|
This option is only relevant when performing a data-only restore.
|
||||||
It instructs <application>pg_restore</application> to execute commands
|
It instructs <application>pg_restore</application> to execute commands
|
||||||
to temporarily disable triggers on the target tables while
|
to temporarily disable triggers on the target tables while
|
||||||
the data is reloaded. Use this if you have referential
|
the data is reloaded. Use this if you have referential
|
||||||
integrity checks or other triggers on the tables that you
|
integrity checks or other triggers on the tables that you
|
||||||
do not want to invoke during data reload.
|
do not want to invoke during data reload.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Presently, the commands emitted for
|
Presently, the commands emitted for
|
||||||
<option>--disable-triggers</> must be done as superuser. So, you
|
<option>--disable-triggers</> must be done as superuser. So, you
|
||||||
should also specify a superuser name with <option>-S</>, or
|
should also specify a superuser name with <option>-S</>, or
|
||||||
preferably run <application>pg_restore</application> as a
|
preferably run <application>pg_restore</application> as a
|
||||||
<productname>PostgreSQL</> superuser.
|
<productname>PostgreSQL</> superuser.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -393,11 +394,11 @@
|
|||||||
<term><option>--host=<replaceable class="parameter">host</replaceable></option></term>
|
<term><option>--host=<replaceable class="parameter">host</replaceable></option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specifies the host name of the machine on which the server is
|
Specifies the host name of the machine on which the server is
|
||||||
running. If the value begins with a slash, it is used as the
|
running. If the value begins with a slash, it is used as the
|
||||||
directory for the Unix domain socket. The default is taken
|
directory for the Unix domain socket. The default is taken
|
||||||
from the <envar>PGHOST</envar> environment variable, if set,
|
from the <envar>PGHOST</envar> environment variable, if set,
|
||||||
else a Unix domain socket connection is attempted.
|
else a Unix domain socket connection is attempted.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -407,10 +408,10 @@
|
|||||||
<term><option>--port=<replaceable class="parameter">port</replaceable></option></term>
|
<term><option>--port=<replaceable class="parameter">port</replaceable></option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specifies the TCP port or local Unix domain socket file
|
Specifies the TCP port or local Unix domain socket file
|
||||||
extension on which the server is listening for connections.
|
extension on which the server is listening for connections.
|
||||||
Defaults to the <envar>PGPORT</envar> environment variable, if
|
Defaults to the <envar>PGPORT</envar> environment variable, if
|
||||||
set, or a compiled-in default.
|
set, or a compiled-in default.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.126 2004/12/28 23:17:38 tgl Exp $
|
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.127 2005/01/04 03:58:16 tgl Exp $
|
||||||
PostgreSQL documentation
|
PostgreSQL documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ PostgreSQL documentation
|
|||||||
<term><option>--echo-all</></term>
|
<term><option>--echo-all</></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Print all the lines to the screen as they are read. This is more
|
Print all input lines to standard output as they are read. This is more
|
||||||
useful for script processing rather than interactive mode. This is
|
useful for script processing rather than interactive mode. This is
|
||||||
equivalent to setting the variable <varname>ECHO</varname> to
|
equivalent to setting the variable <varname>ECHO</varname> to
|
||||||
<literal>all</literal>.
|
<literal>all</literal>.
|
||||||
@ -85,7 +85,7 @@ PostgreSQL documentation
|
|||||||
<replaceable class="parameter">command</replaceable> must be either
|
<replaceable class="parameter">command</replaceable> must be either
|
||||||
a command string that is completely parsable by the server (i.e.,
|
a command string that is completely parsable by the server (i.e.,
|
||||||
it contains no <application>psql</application> specific features),
|
it contains no <application>psql</application> specific features),
|
||||||
or it is a single backslash command. Thus you cannot mix
|
or a single backslash command. Thus you cannot mix
|
||||||
<acronym>SQL</acronym> and <application>psql</application>
|
<acronym>SQL</acronym> and <application>psql</application>
|
||||||
meta-commands. To achieve that, you could pipe the string into
|
meta-commands. To achieve that, you could pipe the string into
|
||||||
<application>psql</application>, like this: <literal>echo "\x \\
|
<application>psql</application>, like this: <literal>echo "\x \\
|
||||||
@ -119,7 +119,8 @@ PostgreSQL documentation
|
|||||||
<term><option>--echo-queries</></term>
|
<term><option>--echo-queries</></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Show all commands that are sent to the server. This is equivalent
|
Copy all SQL commands sent to the server to standard output as well.
|
||||||
|
This is equivalent
|
||||||
to setting the variable <varname>ECHO</varname> to
|
to setting the variable <varname>ECHO</varname> to
|
||||||
<literal>queries</literal>.
|
<literal>queries</literal>.
|
||||||
</para>
|
</para>
|
||||||
@ -132,8 +133,8 @@ PostgreSQL documentation
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Echo the actual queries generated by <command>\d</command> and other backslash
|
Echo the actual queries generated by <command>\d</command> and other backslash
|
||||||
commands. You can use this if you wish to include similar
|
commands. You can use this to study <application>psql</application>'s
|
||||||
functionality into your own programs. This is equivalent to
|
internal operations. This is equivalent to
|
||||||
setting the variable <varname>ECHO_HIDDEN</varname> from within
|
setting the variable <varname>ECHO_HIDDEN</varname> from within
|
||||||
<application>psql</application>.
|
<application>psql</application>.
|
||||||
</para>
|
</para>
|
||||||
@ -214,7 +215,7 @@ PostgreSQL documentation
|
|||||||
<term><option>--list</></term>
|
<term><option>--list</></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
List all available databases, then exits. Other non-connection
|
List all available databases, then exit. Other non-connection
|
||||||
options are ignored. This is similar to the internal command
|
options are ignored. This is similar to the internal command
|
||||||
<command>\list</command>.
|
<command>\list</command>.
|
||||||
</para>
|
</para>
|
||||||
@ -326,8 +327,7 @@ PostgreSQL documentation
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Turn off printing of column names and result row count footers,
|
Turn off printing of column names and result row count footers,
|
||||||
etc. It is completely equivalent to the <command>\t</command>
|
etc. This is equivalent to the <command>\t</command> command.
|
||||||
meta-command.
|
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -396,7 +396,7 @@ PostgreSQL documentation
|
|||||||
<term><option>--version</></term>
|
<term><option>--version</></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Show the <application>psql</application> version.
|
Print the <application>psql</application> version and exit.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -406,7 +406,7 @@ PostgreSQL documentation
|
|||||||
<term><option>--password</></term>
|
<term><option>--password</></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Requests that <application>psql</application> should prompt for a
|
Cause <application>psql</application> to prompt for a
|
||||||
password before connecting to a database. This will remain set for
|
password before connecting to a database. This will remain set for
|
||||||
the entire session, even if you change the database connection
|
the entire session, even if you change the database connection
|
||||||
with the meta-command <command>\connect</command>.
|
with the meta-command <command>\connect</command>.
|
||||||
@ -418,7 +418,7 @@ PostgreSQL documentation
|
|||||||
requests password authentication. Because this is currently based
|
requests password authentication. Because this is currently based
|
||||||
on a hack, the automatic recognition might mysteriously fail,
|
on a hack, the automatic recognition might mysteriously fail,
|
||||||
hence this option to force a prompt. If no password prompt is
|
hence this option to force a prompt. If no password prompt is
|
||||||
issued and the server requires password authentication the
|
issued and the server requires password authentication, the
|
||||||
connection attempt will fail.
|
connection attempt will fail.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -452,7 +452,7 @@ PostgreSQL documentation
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Show help about <application>psql</application> command line
|
Show help about <application>psql</application> command line
|
||||||
arguments.
|
arguments, and exit.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -544,8 +544,8 @@ testdb=>
|
|||||||
Ordinarily, input lines are sent to the server when a
|
Ordinarily, input lines are sent to the server when a
|
||||||
command-terminating semicolon is reached. An end of line does not
|
command-terminating semicolon is reached. An end of line does not
|
||||||
terminate a command. Thus commands can be spread over several lines for
|
terminate a command. Thus commands can be spread over several lines for
|
||||||
clarity. If the command was sent and without error, the results of the command
|
clarity. If the command was sent and executed without error, the results
|
||||||
are displayed on the screen.
|
of the command are displayed on the screen.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
@ -563,8 +563,8 @@ testdb=>
|
|||||||
Anything you enter in <application>psql</application> that begins
|
Anything you enter in <application>psql</application> that begins
|
||||||
with an unquoted backslash is a <application>psql</application>
|
with an unquoted backslash is a <application>psql</application>
|
||||||
meta-command that is processed by <application>psql</application>
|
meta-command that is processed by <application>psql</application>
|
||||||
itself. These commands are what makes
|
itself. These commands help make
|
||||||
<application>psql</application> interesting for administration or
|
<application>psql</application> more useful for administration or
|
||||||
scripting. Meta-commands are more commonly called slash or backslash
|
scripting. Meta-commands are more commonly called slash or backslash
|
||||||
commands.
|
commands.
|
||||||
</para>
|
</para>
|
||||||
@ -637,7 +637,7 @@ testdb=>
|
|||||||
If the current table output format is unaligned, it is switched to aligned.
|
If the current table output format is unaligned, it is switched to aligned.
|
||||||
If it is not unaligned, it is set to unaligned. This command is
|
If it is not unaligned, it is set to unaligned. This command is
|
||||||
kept for backwards compatibility. See <command>\pset</command> for a
|
kept for backwards compatibility. See <command>\pset</command> for a
|
||||||
general solution.
|
more general solution.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -831,6 +831,7 @@ testdb=>
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><literal>\db [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
|
<term><literal>\db [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
|
||||||
|
<term><literal>\db+ [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
@ -991,6 +992,7 @@ testdb=>
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><literal>\dn [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
|
<term><literal>\dn [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
|
||||||
|
<term><literal>\dn+ [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
@ -1088,7 +1090,8 @@ testdb=>
|
|||||||
<application>psql</application> searches the environment
|
<application>psql</application> searches the environment
|
||||||
variables <envar>PSQL_EDITOR</envar>, <envar>EDITOR</envar>, and
|
variables <envar>PSQL_EDITOR</envar>, <envar>EDITOR</envar>, and
|
||||||
<envar>VISUAL</envar> (in that order) for an editor to use. If
|
<envar>VISUAL</envar> (in that order) for an editor to use. If
|
||||||
all of them are unset, <filename>/bin/vi</filename> is run.
|
all of them are unset, <filename>vi</filename> is used on Unix
|
||||||
|
systems, <filename>notepad.exe</filename> on Windows systems.
|
||||||
</para>
|
</para>
|
||||||
</tip>
|
</tip>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -1153,9 +1156,9 @@ Tue Oct 26 21:40:57 CEST 1999
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Sends the current query input buffer to the server and
|
Sends the current query input buffer to the server and
|
||||||
optionally saves the output in <replaceable
|
optionally stores the query's output in <replaceable
|
||||||
class="parameter">filename</replaceable> or pipes the output
|
class="parameter">filename</replaceable> or pipes the output
|
||||||
into a separate Unix shell to execute <replaceable
|
into a separate Unix shell executing <replaceable
|
||||||
class="parameter">command</replaceable>. A bare
|
class="parameter">command</replaceable>. A bare
|
||||||
<literal>\g</literal> is virtually equivalent to a semicolon. A
|
<literal>\g</literal> is virtually equivalent to a semicolon. A
|
||||||
<literal>\g</literal> with argument is a <quote>one-shot</quote>
|
<literal>\g</literal> with argument is a <quote>one-shot</quote>
|
||||||
@ -1582,7 +1585,7 @@ lo_import 152801
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
This command is identical to <command>\echo</command> except
|
This command is identical to <command>\echo</command> except
|
||||||
that all output will be written to the query output channel, as
|
that the output will be written to the query output channel, as
|
||||||
set by <command>\o</command>.
|
set by <command>\o</command>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -1921,7 +1924,7 @@ bar
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
If set to <literal>all</literal>, all lines
|
If set to <literal>all</literal>, all lines
|
||||||
entered or from a script are written to the standard output
|
entered from the keyboard or from a script are written to the standard output
|
||||||
before they are parsed or executed. To select this behavior on program
|
before they are parsed or executed. To select this behavior on program
|
||||||
start-up, use the switch <option>-a</option>. If set to
|
start-up, use the switch <option>-a</option>. If set to
|
||||||
<literal>queries</literal>,
|
<literal>queries</literal>,
|
||||||
@ -2307,11 +2310,12 @@ testdb=> <userinput>\set content '\'' `sed -e "s/'/\\\\\\'/g" < my_file.txt` '\'
|
|||||||
disconnected from the database (which can happen if
|
disconnected from the database (which can happen if
|
||||||
<command>\connect</command> fails). In prompt 2 the sequence is
|
<command>\connect</command> fails). In prompt 2 the sequence is
|
||||||
replaced by <literal>-</literal>, <literal>*</literal>, a single quote,
|
replaced by <literal>-</literal>, <literal>*</literal>, a single quote,
|
||||||
or a double quote, depending on whether
|
a double quote, or a dollar sign, depending on whether
|
||||||
<application>psql</application> expects more input because the
|
<application>psql</application> expects more input because the
|
||||||
command wasn't terminated yet, because you are inside a
|
command wasn't terminated yet, because you are inside a
|
||||||
<literal>/* ... */</literal> comment, or because you are inside
|
<literal>/* ... */</literal> comment, or because you are inside
|
||||||
a quote. In prompt 3 the sequence doesn't produce anything.
|
a quoted or dollar-escaped string. In prompt 3 the sequence doesn't
|
||||||
|
produce anything.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -2416,7 +2420,7 @@ testdb=> \set PROMPT1 '%[%033[1;33;40m%]%n@%/%R%[%033[0m%#%] '
|
|||||||
<application>psql</application> starts up. Tab-completion is also
|
<application>psql</application> starts up. Tab-completion is also
|
||||||
supported, although the completion logic makes no claim to be an
|
supported, although the completion logic makes no claim to be an
|
||||||
<acronym>SQL</acronym> parser. If for some reason you do not like the tab completion, you
|
<acronym>SQL</acronym> parser. If for some reason you do not like the tab completion, you
|
||||||
can turn if off by putting this in a file named
|
can turn it off by putting this in a file named
|
||||||
<filename>.inputrc</filename> in your home directory:
|
<filename>.inputrc</filename> in your home directory:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
$if psql
|
$if psql
|
||||||
@ -2625,8 +2629,8 @@ Field separator is "oo".
|
|||||||
<programlisting>
|
<programlisting>
|
||||||
testdb=> <userinput>CREATE TABLE my_table (</userinput>
|
testdb=> <userinput>CREATE TABLE my_table (</userinput>
|
||||||
testdb(> <userinput> first integer not null default 0,</userinput>
|
testdb(> <userinput> first integer not null default 0,</userinput>
|
||||||
testdb(> <userinput> second text</userinput>
|
testdb(> <userinput> second text)</userinput>
|
||||||
testdb-> <userinput>);</userinput>
|
testdb-> <userinput>;</userinput>
|
||||||
CREATE TABLE
|
CREATE TABLE
|
||||||
</programlisting>
|
</programlisting>
|
||||||
Now look at the table definition again:
|
Now look at the table definition again:
|
||||||
@ -2657,7 +2661,7 @@ peter@localhost testdb=> SELECT * FROM my_table;
|
|||||||
(4 rows)
|
(4 rows)
|
||||||
|
|
||||||
</programlisting>
|
</programlisting>
|
||||||
You can make this table look differently by using the
|
You can display tables in different ways by using the
|
||||||
<command>\pset</command> command:
|
<command>\pset</command> command:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
peter@localhost testdb=> <userinput>\pset border 2</userinput>
|
peter@localhost testdb=> <userinput>\pset border 2</userinput>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$PostgreSQL: pgsql/doc/src/sgml/ref/select.sgml,v 1.78 2004/11/27 21:27:07 petere Exp $
|
$PostgreSQL: pgsql/doc/src/sgml/ref/select.sgml,v 1.79 2005/01/04 03:58:16 tgl Exp $
|
||||||
PostgreSQL documentation
|
PostgreSQL documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
@ -81,6 +81,16 @@ where <replaceable class="parameter">from_item</replaceable> can be one of:
|
|||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The actual output rows are computed using the
|
||||||
|
<command>SELECT</command> output expressions for each selected
|
||||||
|
row. (See
|
||||||
|
<xref linkend="sql-select-list" endterm="sql-select-list-title">
|
||||||
|
below.)
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Using the operators <literal>UNION</literal>,
|
Using the operators <literal>UNION</literal>,
|
||||||
@ -100,16 +110,6 @@ where <replaceable class="parameter">from_item</replaceable> can be one of:
|
|||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
The actual output rows are computed using the
|
|
||||||
<command>SELECT</command> output expressions for each selected
|
|
||||||
row. (See
|
|
||||||
<xref linkend="sql-select-list" endterm="sql-select-list-title">
|
|
||||||
below.)
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
If the <literal>ORDER BY</literal> clause is specified, the
|
If the <literal>ORDER BY</literal> clause is specified, the
|
||||||
@ -453,6 +453,34 @@ HAVING <replaceable class="parameter">condition</replaceable>
|
|||||||
appears within an aggregate function.
|
appears within an aggregate function.
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
|
|
||||||
|
<refsect2 id="sql-select-list">
|
||||||
|
<title id="sql-select-list-title"><command>SELECT</command> List</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
The <command>SELECT</command> list (between the key words
|
||||||
|
<literal>SELECT</> and <literal>FROM</>) specifies expressions
|
||||||
|
that form the output rows of the <command>SELECT</command>
|
||||||
|
statement. The expressions can (and usually do) refer to columns
|
||||||
|
computed in the <literal>FROM</> clause. Using the clause
|
||||||
|
<literal>AS <replaceable
|
||||||
|
class="parameter">output_name</replaceable></literal>, another
|
||||||
|
name can be specified for an output column. This name is
|
||||||
|
primarily used to label the column for display. It can also be
|
||||||
|
used to refer to the column's value in <literal>ORDER BY</> and
|
||||||
|
<literal>GROUP BY</> clauses, but not in the <literal>WHERE</> or
|
||||||
|
<literal>HAVING</> clauses; there you must write out the
|
||||||
|
expression instead.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Instead of an expression, <literal>*</literal> can be written in
|
||||||
|
the output list as a shorthand for all the columns of the selected
|
||||||
|
rows. Also, one can write <literal><replaceable
|
||||||
|
class="parameter">table_name</replaceable>.*</literal> as a
|
||||||
|
shorthand for the columns coming from just that table.
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
|
||||||
<refsect2 id="SQL-UNION">
|
<refsect2 id="SQL-UNION">
|
||||||
<title id="sql-union-title"><literal>UNION</literal> Clause</title>
|
<title id="sql-union-title"><literal>UNION</literal> Clause</title>
|
||||||
@ -486,7 +514,9 @@ HAVING <replaceable class="parameter">condition</replaceable>
|
|||||||
<para>
|
<para>
|
||||||
The result of <literal>UNION</> does not contain any duplicate
|
The result of <literal>UNION</> does not contain any duplicate
|
||||||
rows unless the <literal>ALL</> option is specified.
|
rows unless the <literal>ALL</> option is specified.
|
||||||
<literal>ALL</> prevents elimination of duplicates.
|
<literal>ALL</> prevents elimination of duplicates. (Therefore,
|
||||||
|
<literal>UNION ALL</> is usually significantly quicker than
|
||||||
|
<literal>UNION</>; use <literal>ALL</> when you can.)
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
@ -524,9 +554,9 @@ HAVING <replaceable class="parameter">condition</replaceable>
|
|||||||
<para>
|
<para>
|
||||||
The result of <literal>INTERSECT</literal> does not contain any
|
The result of <literal>INTERSECT</literal> does not contain any
|
||||||
duplicate rows unless the <literal>ALL</> option is specified.
|
duplicate rows unless the <literal>ALL</> option is specified.
|
||||||
With <literal>ALL</>, a row that has m duplicates in the left
|
With <literal>ALL</>, a row that has <replaceable>m</> duplicates in the
|
||||||
table and n duplicates in the right table will appear min(m,n)
|
left table and <replaceable>n</> duplicates in the right table will appear
|
||||||
times in the result set.
|
min(<replaceable>m</>,<replaceable>n</>) times in the result set.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
@ -538,6 +568,11 @@ HAVING <replaceable class="parameter">condition</replaceable>
|
|||||||
C</literal> will be read as <literal>A UNION (B INTERSECT
|
C</literal> will be read as <literal>A UNION (B INTERSECT
|
||||||
C)</literal>.
|
C)</literal>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Currently, <literal>FOR UPDATE</> may not be specified either for
|
||||||
|
an <literal>INTERSECT</> result or for any input of an <literal>INTERSECT</>.
|
||||||
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
|
|
||||||
<refsect2 id="SQL-EXCEPT">
|
<refsect2 id="SQL-EXCEPT">
|
||||||
@ -562,9 +597,9 @@ HAVING <replaceable class="parameter">condition</replaceable>
|
|||||||
<para>
|
<para>
|
||||||
The result of <literal>EXCEPT</literal> does not contain any
|
The result of <literal>EXCEPT</literal> does not contain any
|
||||||
duplicate rows unless the <literal>ALL</> option is specified.
|
duplicate rows unless the <literal>ALL</> option is specified.
|
||||||
With <literal>ALL</>, a row that has m duplicates in the left
|
With <literal>ALL</>, a row that has <replaceable>m</> duplicates in the
|
||||||
table and n duplicates in the right table will appear max(m-n,0)
|
left table and <replaceable>n</> duplicates in the right table will appear
|
||||||
times in the result set.
|
max(<replaceable>m</>-<replaceable>n</>,0) times in the result set.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
@ -573,33 +608,10 @@ HAVING <replaceable class="parameter">condition</replaceable>
|
|||||||
unless parentheses dictate otherwise. <literal>EXCEPT</> binds at
|
unless parentheses dictate otherwise. <literal>EXCEPT</> binds at
|
||||||
the same level as <literal>UNION</>.
|
the same level as <literal>UNION</>.
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
|
||||||
|
|
||||||
<refsect2 id="sql-select-list">
|
|
||||||
<title id="sql-select-list-title"><command>SELECT</command> List</title>
|
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The <command>SELECT</command> list (between the key words
|
Currently, <literal>FOR UPDATE</> may not be specified either for
|
||||||
<literal>SELECT</> and <literal>FROM</>) specifies expressions
|
an <literal>EXCEPT</> result or for any input of an <literal>EXCEPT</>.
|
||||||
that form the output rows of the <command>SELECT</command>
|
|
||||||
statement. The expressions can (and usually do) refer to columns
|
|
||||||
computed in the <literal>FROM</> clause. Using the clause
|
|
||||||
<literal>AS <replaceable
|
|
||||||
class="parameter">output_name</replaceable></literal>, another
|
|
||||||
name can be specified for an output column. This name is
|
|
||||||
primarily used to label the column for display. It can also be
|
|
||||||
used to refer to the column's value in <literal>ORDER BY</> and
|
|
||||||
<literal>GROUP BY</> clauses, but not in the <literal>WHERE</> or
|
|
||||||
<literal>HAVING</> clauses; there you must write out the
|
|
||||||
expression instead.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
Instead of an expression, <literal>*</literal> can be written in
|
|
||||||
the output list as a shorthand for all the columns of the selected
|
|
||||||
rows. Also, one can write <literal><replaceable
|
|
||||||
class="parameter">table_name</replaceable>.*</literal> as a
|
|
||||||
shorthand for the columns coming from just that table.
|
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
|
|
||||||
@ -707,7 +719,7 @@ OFFSET <replaceable class="parameter">start</replaceable>
|
|||||||
When using <literal>LIMIT</>, it is a good idea to use an
|
When using <literal>LIMIT</>, it is a good idea to use an
|
||||||
<literal>ORDER BY</> clause that constrains the result rows into a
|
<literal>ORDER BY</> clause that constrains the result rows into a
|
||||||
unique order. Otherwise you will get an unpredictable subset of
|
unique order. Otherwise you will get an unpredictable subset of
|
||||||
the query's rows---you may be asking for the tenth through
|
the query's rows — you may be asking for the tenth through
|
||||||
twentieth rows, but tenth through twentieth in what ordering? You
|
twentieth rows, but tenth through twentieth in what ordering? You
|
||||||
don't know what ordering unless you specify <literal>ORDER BY</>.
|
don't know what ordering unless you specify <literal>ORDER BY</>.
|
||||||
</para>
|
</para>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$PostgreSQL: pgsql/doc/src/sgml/ref/select_into.sgml,v 1.31 2004/09/26 23:48:07 neilc Exp $
|
$PostgreSQL: pgsql/doc/src/sgml/ref/select_into.sgml,v 1.32 2005/01/04 03:58:16 tgl Exp $
|
||||||
PostgreSQL documentation
|
PostgreSQL documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
@ -95,12 +95,8 @@ SELECT [ ALL | DISTINCT [ ON ( <replaceable class="PARAMETER">expression</replac
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
Prior to <productname>PostgreSQL</> 8.0, the table created by
|
Prior to <productname>PostgreSQL</> 8.0, the table created by
|
||||||
<command>SELECT INTO</command> always included OIDs. Furthermore,
|
<command>SELECT INTO</command> always included OIDs.
|
||||||
these OIDs were newly generated: they were distinct from the OIDs
|
As of <productname>PostgreSQL</> 8.0, the
|
||||||
of any of the rows in the source tables of the <command>SELECT
|
|
||||||
INTO</command> statement. Therefore, if <command>SELECT
|
|
||||||
INTO</command> was frequently executed, the OID counter would be
|
|
||||||
rapidly incremented. As of <productname>PostgreSQL</> 8.0, the
|
|
||||||
inclusion of OIDs in the table created by <command>SELECT
|
inclusion of OIDs in the table created by <command>SELECT
|
||||||
INTO</command> is controlled by the
|
INTO</command> is controlled by the
|
||||||
<xref linkend="guc-default-with-oids"> configuration variable. This
|
<xref linkend="guc-default-with-oids"> configuration variable. This
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$PostgreSQL: pgsql/doc/src/sgml/ref/show.sgml,v 1.36 2004/08/03 20:32:32 tgl Exp $
|
$PostgreSQL: pgsql/doc/src/sgml/ref/show.sgml,v 1.37 2005/01/04 03:58:16 tgl Exp $
|
||||||
PostgreSQL documentation
|
PostgreSQL documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ SHOW ALL
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
True if the current session authorization identifier has
|
True if the current session authorization identifier has
|
||||||
superuser privileges.
|
superuser privileges.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -118,7 +118,7 @@ SHOW ALL
|
|||||||
<term><literal>ALL</literal></term>
|
<term><literal>ALL</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Show the values of all configurations parameters.
|
Show the values of all configuration parameters.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -164,17 +164,17 @@ SHOW geqo;
|
|||||||
Show all settings:
|
Show all settings:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SHOW ALL;
|
SHOW ALL;
|
||||||
name | setting
|
name | setting
|
||||||
-------------------------------+---------------------------------------
|
--------------------------------+----------------------------------------------
|
||||||
australian_timezones | off
|
add_missing_from | on
|
||||||
authentication_timeout | 60
|
archive_command | unset
|
||||||
checkpoint_segments | 3
|
australian_timezones | off
|
||||||
.
|
.
|
||||||
.
|
.
|
||||||
.
|
.
|
||||||
wal_debug | off
|
work_mem | 1024
|
||||||
wal_sync_method | fdatasync
|
zero_damaged_pages | off
|
||||||
(94 rows)
|
(140 rows)
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
@ -193,6 +193,7 @@ SHOW ALL;
|
|||||||
|
|
||||||
<simplelist type="inline">
|
<simplelist type="inline">
|
||||||
<member><xref linkend="SQL-SET" endterm="SQL-SET-title"></member>
|
<member><xref linkend="SQL-SET" endterm="SQL-SET-title"></member>
|
||||||
|
<member><xref linkend="SQL-RESET" endterm="SQL-RESET-title"></member>
|
||||||
</simplelist>
|
</simplelist>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$PostgreSQL: pgsql/doc/src/sgml/ref/update.sgml,v 1.30 2004/08/08 01:48:31 momjian Exp $
|
$PostgreSQL: pgsql/doc/src/sgml/ref/update.sgml,v 1.31 2005/01/04 03:58:16 tgl Exp $
|
||||||
PostgreSQL documentation
|
PostgreSQL documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
@ -150,6 +150,26 @@ UPDATE <replaceable class="parameter">count</replaceable>
|
|||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1>
|
||||||
|
<title>Notes</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
When joining the target table to other tables using a <replaceable
|
||||||
|
class="PARAMETER">fromlist</replaceable>, be careful that the join
|
||||||
|
produces at most one output row for each row to be modified. In
|
||||||
|
other words, a target row mustn't join to more than one row from
|
||||||
|
the other table(s). If it does, then only one of the join rows
|
||||||
|
will be used to update the target row, but which one will be used
|
||||||
|
is not readily predictable.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Because of this indeterminancy, referencing other tables only within
|
||||||
|
sub-selects is safer, though often harder to read and slower than
|
||||||
|
using a join.
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
<title>Examples</title>
|
<title>Examples</title>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user