Skip to content

Commit 6b64704

Browse files
committed
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
1 parent 7312c19 commit 6b64704

File tree

4 files changed

+34
-28
lines changed

4 files changed

+34
-28
lines changed

doc/src/sgml/ref/copy.sgml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/copy.sgml,v 1.35 2002/08/02 18:15:04 tgl Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/copy.sgml,v 1.36 2002/08/04 05:09:36 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -57,7 +57,7 @@ COPY <replaceable class="parameter">table</replaceable> [ ( <replaceable class="
5757
</varlistentry>
5858

5959
<varlistentry>
60-
<term><replaceable class="parameter">column list</replaceable></term>
60+
<term><replaceable class="parameter">column</replaceable></term>
6161
<listitem>
6262
<para>
6363
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="
9999
<para>
100100
Changes the behavior of field formatting, forcing all data to be
101101
stored or read in binary format rather than as text. You can not
102-
specify DELIMITER or NULL in binary mode.
102+
specify <option>DELIMITER</option>, <option>NULL</option>, or
103+
a column list in binary mode.
103104
</para>
104105
</listitem>
105106
</varlistentry>
@@ -117,7 +118,7 @@ COPY <replaceable class="parameter">table</replaceable> [ ( <replaceable class="
117118
<term><replaceable class="parameter">delimiter</replaceable></term>
118119
<listitem>
119120
<para>
120-
The character that separates fields within each row (line) of the file.
121+
The single character that separates fields within each row (line) of the file.
121122
</para>
122123
</listitem>
123124
</varlistentry>
@@ -189,9 +190,7 @@ ERROR: <replaceable>reason</replaceable>
189190
<para>
190191
<command>COPY</command> moves data between
191192
<productname>PostgreSQL</productname> tables and standard file-system
192-
files.
193-
194-
<command>COPY TO</command> copies the entire contents of a table
193+
files. <command>COPY TO</command> copies the contents of a table
195194
<emphasis>to</> a file, while <command>COPY FROM</command> copies
196195
data <emphasis>from</> a file to a table (appending the data to
197196
whatever is in the table already).
@@ -200,7 +199,7 @@ ERROR: <replaceable>reason</replaceable>
200199
<para>
201200
If a list of columns is specified, <command>COPY</command> will
202201
only copy the data in the specified columns to or from the file.
203-
If there are any columns in the table that are not in the file,
202+
If there are any columns in the table that are not in the column list,
204203
<command>COPY FROM</command> will insert the default values for
205204
those columns.
206205
</para>
@@ -249,8 +248,8 @@ ERROR: <replaceable>reason</replaceable>
249248
<para>
250249
By default, a text copy uses a tab ("\t") character as a delimiter
251250
between fields. The field delimiter may be changed to any other
252-
single character with the keyword DELIMITER. Characters in data
253-
fields that happen to match the delimiter character will be
251+
single character with the keyword <option>DELIMITER</option>. Characters
252+
in data fields that happen to match the delimiter character will be
254253
backslash quoted.
255254
</para>
256255

@@ -635,15 +634,14 @@ OIDs to be shown as NULL if that ever proves desirable.
635634
Usage
636635
</title>
637636
<para>
638-
The following example copies a table to standard output,
639-
using a vertical bar (|) as the field
640-
delimiter:
637+
The following example copies a table to standard output,
638+
using a vertical bar (|) as the field delimiter:
641639
</para>
642640
<programlisting>
643641
COPY country TO <filename>stdout</filename> WITH DELIMITER '|';
644642
</programlisting>
645643
<para>
646-
To copy data from a Unix file into a table country:
644+
To copy data from a Unix file into the <literal>country</> table:
647645
</para>
648646
<programlisting>
649647
COPY country FROM '/usr1/proj/bray/sql/country_data';

doc/src/sgml/ref/set.sgml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.63 2002/08/04 03:53:11 momjian Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.64 2002/08/04 05:09:36 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -404,7 +404,8 @@ SELECT setseed(<replaceable>value</replaceable>);
404404
</varlistentry>
405405

406406
<varlistentry>
407-
<term><computeroutput>ERROR: not a valid option name: <replaceable>name</replaceable></computeroutput></term>
407+
<term><computeroutput>ERROR: '<replaceable>name</replaceable> is not a
408+
valid option name</computeroutput></term>
408409
<listitem>
409410
<para>
410411
The parameter you tried to set does not exist.
@@ -413,7 +414,8 @@ SELECT setseed(<replaceable>value</replaceable>);
413414
</varlistentry>
414415

415416
<varlistentry>
416-
<term><computeroutput>ERROR: permission denied</computeroutput></term>
417+
<term><computeroutput>ERROR: '<replaceable>name</replaceable>':
418+
permission denied</computeroutput></term>
417419
<listitem>
418420
<para>
419421
You must be a superuser to alter certain settings.
@@ -422,7 +424,8 @@ SELECT setseed(<replaceable>value</replaceable>);
422424
</varlistentry>
423425

424426
<varlistentry>
425-
<term><computeroutput>ERROR: <replaceable>name</replaceable> can only be set at start-up</computeroutput></term>
427+
<term><computeroutput>ERROR: '<replaceable>name</replaceable>' cannot
428+
be changed after server start</computeroutput></term>
426429
<listitem>
427430
<para>
428431
Some parameters are fixed once the server is started.

doc/src/sgml/ref/show.sgml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/show.sgml,v 1.18 2002/08/04 03:53:11 momjian Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/show.sgml,v 1.19 2002/08/04 05:09:36 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -54,7 +54,11 @@ SHOW ALL
5454
<para>
5555
<command>SHOW</command> will display the current setting of a
5656
run-time parameter. These variables can be set using the
57-
<command>SET</command> statement or are determined at session start.
57+
<command>SET</command> statement, by editing the
58+
<filename>postgresql.conf</filename>, through the
59+
<envar>PGOPTIONS</envar> environmental variable, or through a
60+
command-line flag when starting the
61+
<application>postmaster</application>.
5862
</para>
5963
</refsect1>
6064

@@ -64,10 +68,11 @@ SHOW ALL
6468
<para>
6569
<variablelist>
6670
<varlistentry>
67-
<term><computeroutput>ERROR: not a valid option name: <replaceable>name</replaceable></computeroutput></term>
71+
<term><computeroutput>ERROR: Option '<replaceable>name</replaceable>'
72+
is not recognized</computeroutput></term>
6873
<listitem>
6974
<para>
70-
Message returned if <replaceable>variable</replaceable> does
75+
Message returned if <replaceable>name</replaceable> does
7176
not stand for an existing parameter.
7277
</para>
7378
</listitem>
@@ -81,24 +86,25 @@ SHOW ALL
8186
<para>
8287
Show the current <literal>DateStyle</literal> setting:
8388

84-
<screen>
89+
<programlisting>
8590
SHOW DateStyle;
8691
DateStyle
8792
---------------------------------------
8893
ISO with US (NonEuropean) conventions
8994
(1 row)
90-
</screen>
95+
</programlisting>
9196
</para>
9297

9398
<para>
9499
Show the current genetic optimizer (<literal>geqo</literal>) setting:
100+
<programlisting>
95101
<screen>
96102
SHOW GEQO;
97103
geqo
98104
------
99105
on
100106
(1 row)
101-
</screen>
107+
</programlisting>
102108
</para>
103109

104110
<para>

src/backend/postmaster/pgstat.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* Copyright (c) 2001, PostgreSQL Global Development Group
1818
*
19-
* $Header: /cvsroot/pgsql/src/backend/postmaster/pgstat.c,v 1.22 2002/07/20 05:16:58 momjian Exp $
19+
* $Header: /cvsroot/pgsql/src/backend/postmaster/pgstat.c,v 1.23 2002/08/04 05:09:36 momjian Exp $
2020
* ----------
2121
*/
2222
#include "postgres.h"
@@ -382,10 +382,9 @@ pgstat_beterm(int pid)
382382
if (pgStatSock < 0)
383383
return;
384384

385+
MemSet(&(msg.m_hdr), 0, sizeof(msg.m_hdr));
385386
msg.m_hdr.m_type = PGSTAT_MTYPE_BETERM;
386-
msg.m_hdr.m_backendid = 0;
387387
msg.m_hdr.m_procpid = pid;
388-
msg.m_hdr.m_databaseid = 0;
389388

390389
pgstat_send(&msg, sizeof(msg));
391390
}

0 commit comments

Comments
 (0)