diff options
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/ref/copy.sgml | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/doc/src/sgml/ref/copy.sgml b/doc/src/sgml/ref/copy.sgml index 28ca264c65c..a1a5e9baa76 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.32 2002/06/20 16:00:43 momjian Exp $ +$Header: /cvsroot/pgsql/doc/src/sgml/ref/copy.sgml,v 1.33 2002/07/18 04:43:50 momjian Exp $ PostgreSQL documentation --> @@ -21,7 +21,8 @@ PostgreSQL documentation <date>1999-12-11</date> </refsynopsisdivinfo> <synopsis> -COPY <replaceable class="parameter">table</replaceable> +COPY <replaceable class="parameter">table</replaceable> + [ ( <replaceable class="parameter">column</replaceable> [, ...] ) ] FROM { '<replaceable class="parameter">filename</replaceable>' | <filename>stdin</filename> } [ [ WITH ] [ BINARY ] @@ -29,6 +30,7 @@ COPY <replaceable class="parameter">table</replaceable> [ DELIMITER [ AS ] '<replaceable class="parameter">delimiter</replaceable>' ] [ NULL [ AS ] '<replaceable class="parameter">null string</replaceable>' ] ] COPY <replaceable class="parameter">table</replaceable> + [ ( <replaceable class="parameter">column</replaceable> [, ...] ) ] TO { '<replaceable class="parameter">filename</replaceable>' | <filename>stdout</filename> } [ [ WITH ] [ BINARY ] @@ -55,6 +57,16 @@ COPY <replaceable class="parameter">table</replaceable> </para> </listitem> </varlistentry> + + <varlistentry> + <term><replaceable class="parameter">column list</replaceable></term> + <listitem> + <para> + An optional list of columns to be copied. If no column list is + specified, all columns will be used. + </para> + </listitem> + </varlistentry> <varlistentry> <term><replaceable class="parameter">filename</replaceable></term> @@ -187,6 +199,14 @@ 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> + <para> <command>COPY</command> with a file name instructs the <productname>PostgreSQL</productname> backend to directly read from |