Skip to content

Commit ef96196

Browse files
committed
CSV NULL Documentation
Update docs to clearly explain NULL value matching behavior, per Andrew. Backpatch to 8.4.X.
1 parent 87f4a26 commit ef96196

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

doc/src/sgml/ref/copy.sgml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/copy.sgml,v 1.88 2009/09/17 21:13:01 momjian Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/copy.sgml,v 1.89 2009/09/17 21:49:15 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -550,10 +550,13 @@ COPY <replaceable class="parameter">count</replaceable>
550550
<para>
551551
The <literal>CSV</> format has no standard way to distinguish a
552552
<literal>NULL</> value from an empty string.
553-
<productname>PostgreSQL</>'s <command>COPY</> handles this using
554-
quoting. A <literal>NULL</> is output as an empty string without
555-
quotes, while an empty string data value is double-quoted
556-
(<literal>""</>). Reading values follows similar rules. You can
553+
<productname>PostgreSQL</>'s <command>COPY</> handles this by
554+
quoting. A <literal>NULL</> is output as the <literal>NULL</>
555+
parameter and is not quoted, while a non-NULL value matching the
556+
the <literal>NULL</> parameter string is quoted. Therefore, using the default
557+
settings, a <literal>NULL</> is written as an unquoted empty
558+
string, while an empty string data value is written with double quotes
559+
(<literal>""</>). Reading values follows similar rules. You can
557560
use <literal>FORCE NOT NULL</> to prevent <literal>NULL</> input
558561
comparisons for specific columns.
559562
</para>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy