mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-18 18:44:06 +08:00
This patch fixes a probably harmless write of uninitialized memory in
the statistics collector and makes a number of corrections to the documentation for SET, SHOW, and COPY. Neil Conway
This commit is contained in:
parent
7312c19ab5
commit
6b64704e4f
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/copy.sgml,v 1.35 2002/08/02 18:15:04 tgl Exp $
|
$Header: /cvsroot/pgsql/doc/src/sgml/ref/copy.sgml,v 1.36 2002/08/04 05:09:36 momjian Exp $
|
||||||
PostgreSQL documentation
|
PostgreSQL documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ COPY <replaceable class="parameter">table</replaceable> [ ( <replaceable class="
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><replaceable class="parameter">column list</replaceable></term>
|
<term><replaceable class="parameter">column</replaceable></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
An optional list of columns to be copied. If no column list is
|
An optional list of columns to be copied. If no column list is
|
||||||
@ -99,7 +99,8 @@ COPY <replaceable class="parameter">table</replaceable> [ ( <replaceable class="
|
|||||||
<para>
|
<para>
|
||||||
Changes the behavior of field formatting, forcing all data to be
|
Changes the behavior of field formatting, forcing all data to be
|
||||||
stored or read in binary format rather than as text. You can not
|
stored or read in binary format rather than as text. You can not
|
||||||
specify DELIMITER or NULL in binary mode.
|
specify <option>DELIMITER</option>, <option>NULL</option>, or
|
||||||
|
a column list in binary mode.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -117,7 +118,7 @@ COPY <replaceable class="parameter">table</replaceable> [ ( <replaceable class="
|
|||||||
<term><replaceable class="parameter">delimiter</replaceable></term>
|
<term><replaceable class="parameter">delimiter</replaceable></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The character that separates fields within each row (line) of the file.
|
The single character that separates fields within each row (line) of the file.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -189,9 +190,7 @@ ERROR: <replaceable>reason</replaceable>
|
|||||||
<para>
|
<para>
|
||||||
<command>COPY</command> moves data between
|
<command>COPY</command> moves data between
|
||||||
<productname>PostgreSQL</productname> tables and standard file-system
|
<productname>PostgreSQL</productname> tables and standard file-system
|
||||||
files.
|
files. <command>COPY TO</command> copies the contents of a table
|
||||||
|
|
||||||
<command>COPY TO</command> copies the entire contents of a table
|
|
||||||
<emphasis>to</> a file, while <command>COPY FROM</command> copies
|
<emphasis>to</> a file, while <command>COPY FROM</command> copies
|
||||||
data <emphasis>from</> a file to a table (appending the data to
|
data <emphasis>from</> a file to a table (appending the data to
|
||||||
whatever is in the table already).
|
whatever is in the table already).
|
||||||
@ -200,7 +199,7 @@ ERROR: <replaceable>reason</replaceable>
|
|||||||
<para>
|
<para>
|
||||||
If a list of columns is specified, <command>COPY</command> will
|
If a list of columns is specified, <command>COPY</command> will
|
||||||
only copy the data in the specified columns to or from the file.
|
only copy the data in the specified columns to or from the file.
|
||||||
If there are any columns in the table that are not in the file,
|
If there are any columns in the table that are not in the column list,
|
||||||
<command>COPY FROM</command> will insert the default values for
|
<command>COPY FROM</command> will insert the default values for
|
||||||
those columns.
|
those columns.
|
||||||
</para>
|
</para>
|
||||||
@ -249,8 +248,8 @@ ERROR: <replaceable>reason</replaceable>
|
|||||||
<para>
|
<para>
|
||||||
By default, a text copy uses a tab ("\t") character as a delimiter
|
By default, a text copy uses a tab ("\t") character as a delimiter
|
||||||
between fields. The field delimiter may be changed to any other
|
between fields. The field delimiter may be changed to any other
|
||||||
single character with the keyword DELIMITER. Characters in data
|
single character with the keyword <option>DELIMITER</option>. Characters
|
||||||
fields that happen to match the delimiter character will be
|
in data fields that happen to match the delimiter character will be
|
||||||
backslash quoted.
|
backslash quoted.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -635,15 +634,14 @@ OIDs to be shown as NULL if that ever proves desirable.
|
|||||||
Usage
|
Usage
|
||||||
</title>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
The following example copies a table to standard output,
|
The following example copies a table to standard output,
|
||||||
using a vertical bar (|) as the field
|
using a vertical bar (|) as the field delimiter:
|
||||||
delimiter:
|
|
||||||
</para>
|
</para>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
COPY country TO <filename>stdout</filename> WITH DELIMITER '|';
|
COPY country TO <filename>stdout</filename> WITH DELIMITER '|';
|
||||||
</programlisting>
|
</programlisting>
|
||||||
<para>
|
<para>
|
||||||
To copy data from a Unix file into a table country:
|
To copy data from a Unix file into the <literal>country</> table:
|
||||||
</para>
|
</para>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
COPY country FROM '/usr1/proj/bray/sql/country_data';
|
COPY country FROM '/usr1/proj/bray/sql/country_data';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.63 2002/08/04 03:53:11 momjian Exp $
|
$Header: /cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.64 2002/08/04 05:09:36 momjian Exp $
|
||||||
PostgreSQL documentation
|
PostgreSQL documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
@ -404,7 +404,8 @@ SELECT setseed(<replaceable>value</replaceable>);
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><computeroutput>ERROR: not a valid option name: <replaceable>name</replaceable></computeroutput></term>
|
<term><computeroutput>ERROR: '<replaceable>name</replaceable> is not a
|
||||||
|
valid option name</computeroutput></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The parameter you tried to set does not exist.
|
The parameter you tried to set does not exist.
|
||||||
@ -413,7 +414,8 @@ SELECT setseed(<replaceable>value</replaceable>);
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><computeroutput>ERROR: permission denied</computeroutput></term>
|
<term><computeroutput>ERROR: '<replaceable>name</replaceable>':
|
||||||
|
permission denied</computeroutput></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
You must be a superuser to alter certain settings.
|
You must be a superuser to alter certain settings.
|
||||||
@ -422,7 +424,8 @@ SELECT setseed(<replaceable>value</replaceable>);
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><computeroutput>ERROR: <replaceable>name</replaceable> can only be set at start-up</computeroutput></term>
|
<term><computeroutput>ERROR: '<replaceable>name</replaceable>' cannot
|
||||||
|
be changed after server start</computeroutput></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Some parameters are fixed once the server is started.
|
Some parameters are fixed once the server is started.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/show.sgml,v 1.18 2002/08/04 03:53:11 momjian Exp $
|
$Header: /cvsroot/pgsql/doc/src/sgml/ref/show.sgml,v 1.19 2002/08/04 05:09:36 momjian Exp $
|
||||||
PostgreSQL documentation
|
PostgreSQL documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
@ -54,7 +54,11 @@ SHOW ALL
|
|||||||
<para>
|
<para>
|
||||||
<command>SHOW</command> will display the current setting of a
|
<command>SHOW</command> will display the current setting of a
|
||||||
run-time parameter. These variables can be set using the
|
run-time parameter. These variables can be set using the
|
||||||
<command>SET</command> statement or are determined at session start.
|
<command>SET</command> statement, by editing the
|
||||||
|
<filename>postgresql.conf</filename>, through the
|
||||||
|
<envar>PGOPTIONS</envar> environmental variable, or through a
|
||||||
|
command-line flag when starting the
|
||||||
|
<application>postmaster</application>.
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
@ -64,10 +68,11 @@ SHOW ALL
|
|||||||
<para>
|
<para>
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><computeroutput>ERROR: not a valid option name: <replaceable>name</replaceable></computeroutput></term>
|
<term><computeroutput>ERROR: Option '<replaceable>name</replaceable>'
|
||||||
|
is not recognized</computeroutput></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Message returned if <replaceable>variable</replaceable> does
|
Message returned if <replaceable>name</replaceable> does
|
||||||
not stand for an existing parameter.
|
not stand for an existing parameter.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -81,24 +86,25 @@ SHOW ALL
|
|||||||
<para>
|
<para>
|
||||||
Show the current <literal>DateStyle</literal> setting:
|
Show the current <literal>DateStyle</literal> setting:
|
||||||
|
|
||||||
<screen>
|
<programlisting>
|
||||||
SHOW DateStyle;
|
SHOW DateStyle;
|
||||||
DateStyle
|
DateStyle
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
ISO with US (NonEuropean) conventions
|
ISO with US (NonEuropean) conventions
|
||||||
(1 row)
|
(1 row)
|
||||||
</screen>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Show the current genetic optimizer (<literal>geqo</literal>) setting:
|
Show the current genetic optimizer (<literal>geqo</literal>) setting:
|
||||||
|
<programlisting>
|
||||||
<screen>
|
<screen>
|
||||||
SHOW GEQO;
|
SHOW GEQO;
|
||||||
geqo
|
geqo
|
||||||
------
|
------
|
||||||
on
|
on
|
||||||
(1 row)
|
(1 row)
|
||||||
</screen>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 2001, PostgreSQL Global Development Group
|
* Copyright (c) 2001, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* $Header: /cvsroot/pgsql/src/backend/postmaster/pgstat.c,v 1.22 2002/07/20 05:16:58 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/postmaster/pgstat.c,v 1.23 2002/08/04 05:09:36 momjian Exp $
|
||||||
* ----------
|
* ----------
|
||||||
*/
|
*/
|
||||||
#include "postgres.h"
|
#include "postgres.h"
|
||||||
@ -382,10 +382,9 @@ pgstat_beterm(int pid)
|
|||||||
if (pgStatSock < 0)
|
if (pgStatSock < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
MemSet(&(msg.m_hdr), 0, sizeof(msg.m_hdr));
|
||||||
msg.m_hdr.m_type = PGSTAT_MTYPE_BETERM;
|
msg.m_hdr.m_type = PGSTAT_MTYPE_BETERM;
|
||||||
msg.m_hdr.m_backendid = 0;
|
|
||||||
msg.m_hdr.m_procpid = pid;
|
msg.m_hdr.m_procpid = pid;
|
||||||
msg.m_hdr.m_databaseid = 0;
|
|
||||||
|
|
||||||
pgstat_send(&msg, sizeof(msg));
|
pgstat_send(&msg, sizeof(msg));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user