Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4cab43e

Browse files
committed
docs: clarify handling of column lists in COPY TO/FROM
Previously it was unclear how COPY FROM handled cases where not all columns were specified, or if the order didn't match. Reported-by: pavlo.golub@gmail.com Discussion: https://postgr.es/m/157487729344.7213.14245726713444755296@wrigleys.postgresql.org Backpatch-through: 9.4
1 parent 0af0504 commit 4cab43e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

doc/src/sgml/ref/copy.sgml

+5-5
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ COPY { <replaceable class="parameter">table_name</replaceable> [ ( <replaceable
6161
</para>
6262

6363
<para>
64-
If a list of columns is specified, <command>COPY</command> will
65-
only copy the data in the specified columns to or from the file.
66-
If there are any columns in the table that are not in the column list,
67-
<command>COPY FROM</command> will insert the default values for
68-
those columns.
64+
If a column list is specified, <command>COPY TO</command> copies only
65+
the data in the specified columns to the file. For <command>COPY
66+
FROM</command>, each field in the file is inserted, in order, into the
67+
specified column. Table columns not specified in the <command>COPY
68+
FROM</command> column list will receive their default values.
6969
</para>
7070

7171
<para>

0 commit comments

Comments
 (0)