Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit874148f

Browse files
committed
IMPROVED VERSION APPLIED:
The attached patch completes the following TODO item: * Generate failure on short COPY lines rather than pad NULLsI also restructed a lot of the existing COPY code, did some codereview on the column list patch sent in by Brent Verner a littlewhile ago, and added some regression tests. I also added anexplicit check (and resultant error) for extra data beforethe end-of-line.Neil Conway
1 parent1dedbf2 commit874148f

File tree

4 files changed

+319
-210
lines changed

4 files changed

+319
-210
lines changed

‎doc/src/sgml/ref/copy.sgml

Lines changed: 15 additions & 10 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.33 2002/07/18 04:43:50 momjian Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/copy.sgml,v 1.34 2002/07/30 16:55:05 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -199,12 +199,12 @@ ERROR: <replaceable>reason</replaceable>
199199
whatever is in the table already).
200200
</para>
201201

202-
<para>
203-
When using the optional column list syntax, <command>COPY TO</command>
204-
and <command>COPY FROM</command> willonly copy the specified
205-
columns' values to/fromthe table. If a column in the table
206-
is not in the column list,<command>COPY FROM</command> will insert
207-
default values forthat column if a default value is defined.
202+
<para>
203+
If a list of columns is specified, <command>COPY</command>will
204+
only copy thedata in thespecified columns to or from the table.
205+
If there are any columns inthe table that are not in the table,
206+
<command>COPY FROM</command> will insertthe default value for
207+
that column.
208208
</para>
209209

210210
<para>
@@ -266,8 +266,8 @@ ERROR: <replaceable>reason</replaceable>
266266
</para>
267267

268268
<para>
269-
<command>COPY FROM</command>neither invokes rules nor acts on column
270-
defaults. It doesinvoketriggers and check constraints.
269+
<command>COPY FROM</command>will invoke any triggers or check
270+
constraints. However, it will notinvokerules.
271271
</para>
272272

273273
<para>
@@ -330,7 +330,12 @@ ERROR: <replaceable>reason</replaceable>
330330
The attribute values themselves are strings generated by the
331331
output function, or acceptable to the input function, of each
332332
attribute's data type. The specified null-value string is used in
333-
place of attributes that are NULL.
333+
place of attributes that are NULL. When using <command>COPY
334+
FROM</command> without a column list, each row of the input file
335+
must contain data for each attribute in the table: no missing data
336+
is allowed. Similarly, <command>COPY FROM</command> will raise
337+
an error if it encounters any data in the input file that would
338+
not be inserted into the table: extra data is not allowed.
334339
</para>
335340
<para>
336341
If OIDS is specified, the OID is read or written as the first column,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp