mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Add a DEFAULT option to COPY FROM
This allows for a string which if an input field matches causes the column's default value to be inserted. The advantage of this is that the default can be inserted in some rows and not others, for which non-default data is available. The file_fdw extension is also modified to take allow use of this option. Israel Barth Rubio Discussion: https://postgr.es/m/CAO_rXXAcqesk6DsvioOZ5zmeEmpUN5ktZf-9=9yu+DTr0Xr8Uw@mail.gmail.com
This commit is contained in:
@ -43,6 +43,7 @@ COPY { <replaceable class="parameter">table_name</replaceable> [ ( <replaceable
|
||||
FORCE_NOT_NULL ( <replaceable class="parameter">column_name</replaceable> [, ...] )
|
||||
FORCE_NULL ( <replaceable class="parameter">column_name</replaceable> [, ...] )
|
||||
ENCODING '<replaceable class="parameter">encoding_name</replaceable>'
|
||||
DEFAULT '<replaceable class="parameter">default_string</replaceable>'
|
||||
</synopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
@ -368,6 +369,19 @@ COPY { <replaceable class="parameter">table_name</replaceable> [ ( <replaceable
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><literal>DEFAULT</literal></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the string that represents a default value. Each time the string
|
||||
is found in the input file, the default value of the corresponding column
|
||||
will be used.
|
||||
This option is allowed only in <command>COPY FROM</command>, and only when
|
||||
not using <literal>binary</literal> format.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><literal>WHERE</literal></term>
|
||||
<listitem>
|
||||
|
Reference in New Issue
Block a user