diff options
author | Bruce Momjian <bruce@momjian.us> | 2002-07-30 16:55:06 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2002-07-30 16:55:06 +0000 |
commit | 874148fe34d404d8dc77d8ed7482f16f5aaad5ba (patch) | |
tree | 8e71bbe88379e931a809105e41417dac93566a7d /doc/src | |
parent | 1dedbf2da5c4aa741bbc6f16dc3ad819625b84f0 (diff) | |
download | postgresql-874148fe34d404d8dc77d8ed7482f16f5aaad5ba.tar.gz postgresql-874148fe34d404d8dc77d8ed7482f16f5aaad5ba.zip |
IMPROVED VERSION APPLIED:
The attached patch completes the following TODO item:
* Generate failure on short COPY lines rather than pad NULLs
I also restructed a lot of the existing COPY code, did some code
review on the column list patch sent in by Brent Verner a little
while ago, and added some regression tests. I also added an
explicit check (and resultant error) for extra data before
the end-of-line.
Neil Conway
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/ref/copy.sgml | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/doc/src/sgml/ref/copy.sgml b/doc/src/sgml/ref/copy.sgml index a1a5e9baa76..484b0a62087 100644 --- a/doc/src/sgml/ref/copy.sgml +++ b/doc/src/sgml/ref/copy.sgml @@ -1,5 +1,5 @@ <!-- -$Header: /cvsroot/pgsql/doc/src/sgml/ref/copy.sgml,v 1.33 2002/07/18 04:43:50 momjian Exp $ +$Header: /cvsroot/pgsql/doc/src/sgml/ref/copy.sgml,v 1.34 2002/07/30 16:55:05 momjian Exp $ PostgreSQL documentation --> @@ -199,12 +199,12 @@ ERROR: <replaceable>reason</replaceable> whatever is in the table already). </para> - <para> - When using the optional column list syntax, <command>COPY TO</command> - and <command>COPY FROM</command> will only copy the specified - columns' values to/from the table. If a column in the table - is not in the column list, <command>COPY FROM</command> will insert - default values for that column if a default value is defined. + <para> + If a list of columns is specified, <command>COPY</command> will + only copy the data in the specified columns to or from the table. + If there are any columns in the table that are not in the table, + <command>COPY FROM</command> will insert the default value for + that column. </para> <para> @@ -266,8 +266,8 @@ ERROR: <replaceable>reason</replaceable> </para> <para> - <command>COPY FROM</command> neither invokes rules nor acts on column - defaults. It does invoke triggers and check constraints. + <command>COPY FROM</command> will invoke any triggers or check + constraints. However, it will not invoke rules. </para> <para> @@ -330,7 +330,12 @@ ERROR: <replaceable>reason</replaceable> The attribute values themselves are strings generated by the output function, or acceptable to the input function, of each attribute's data type. The specified null-value string is used in - place of attributes that are NULL. + place of attributes that are NULL. When using <command>COPY + FROM</command> without a column list, each row of the input file + must contain data for each attribute in the table: no missing data + is allowed. Similarly, <command>COPY FROM</command> will raise + an error if it encounters any data in the input file that would + not be inserted into the table: extra data is not allowed. </para> <para> If OIDS is specified, the OID is read or written as the first column, |