aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2023-09-30 12:34:41 -0400
committerAndrew Dunstan <andrew@dunslane.net>2023-09-30 12:34:41 -0400
commitf6d4c9cf162b70f2837fb6c2a83e80a3f3410695 (patch)
tree23d62216e9b51f67ea5aff1bad95f5434b2bcd1c /doc/src
parentc181f2e2bcecc2704c6461a0543894a38d7143df (diff)
downloadpostgresql-f6d4c9cf162b70f2837fb6c2a83e80a3f3410695.tar.gz
postgresql-f6d4c9cf162b70f2837fb6c2a83e80a3f3410695.zip
Provide FORCE_NULL * and FORCE_NOT_NULL * options for COPY FROM
These options already exist, but you need to specify a column list for them, which can be cumbersome. We already have the possibility of all columns for FORCE QUOTE, so this is simply extending that facility to FORCE_NULL and FORCE_NOT_NULL. Author: Zhang Mingli Reviewed-By: Richard Guo, Kyatoro Horiguchi, Michael Paquier. Discussion: https://postgr.es/m/CACJufxEnVqzOFtqhexF2+AwOKFrV8zHOY3y=p+gPK6eB14pn_w@mail.gmail.com
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/ref/copy.sgml6
1 files changed, 4 insertions, 2 deletions
diff --git a/doc/src/sgml/ref/copy.sgml b/doc/src/sgml/ref/copy.sgml
index 4d614a0225d..d12ba96497a 100644
--- a/doc/src/sgml/ref/copy.sgml
+++ b/doc/src/sgml/ref/copy.sgml
@@ -41,8 +41,8 @@ COPY { <replaceable class="parameter">table_name</replaceable> [ ( <replaceable
QUOTE '<replaceable class="parameter">quote_character</replaceable>'
ESCAPE '<replaceable class="parameter">escape_character</replaceable>'
FORCE_QUOTE { ( <replaceable class="parameter">column_name</replaceable> [, ...] ) | * }
- FORCE_NOT_NULL ( <replaceable class="parameter">column_name</replaceable> [, ...] )
- FORCE_NULL ( <replaceable class="parameter">column_name</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>'
</synopsis>
</refsynopsisdiv>
@@ -350,6 +350,7 @@ COPY { <replaceable class="parameter">table_name</replaceable> [ ( <replaceable
In the default case where the null string is empty, this means that
empty values will be read as zero-length strings rather than nulls,
even when they are not quoted.
+ If <literal>*</literal> is specified, the option will be applied to all columns.
This option is allowed only in <command>COPY FROM</command>, and only when
using <literal>CSV</literal> format.
</para>
@@ -364,6 +365,7 @@ COPY { <replaceable class="parameter">table_name</replaceable> [ ( <replaceable
if it has been quoted, and if a match is found set the value to
<literal>NULL</literal>. In the default case where the null string is empty,
this converts a quoted empty string into NULL.
+ If <literal>*</literal> is specified, the option will be applied to all columns.
This option is allowed only in <command>COPY FROM</command>, and only when
using <literal>CSV</literal> format.
</para>