From: Bruce Momjian Date: Thu, 17 Sep 2009 21:49:22 +0000 (+0000) Subject: CSV NULL Documentation X-Git-Tag: REL8_4_2~61 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=541569caed0955bd3c6bb09d9a1d23e3d1e28da6;p=postgresql CSV NULL Documentation Update docs to clearly explain NULL value matching behavior, per Andrew. Backpatch to 8.4.X. --- diff --git a/doc/src/sgml/ref/copy.sgml b/doc/src/sgml/ref/copy.sgml index 238397828f..23a3ef0b9b 100644 --- a/doc/src/sgml/ref/copy.sgml +++ b/doc/src/sgml/ref/copy.sgml @@ -1,5 +1,5 @@ @@ -544,10 +544,13 @@ COPY count The CSV format has no standard way to distinguish a NULL value from an empty string. - PostgreSQL's COPY handles this using - quoting. A NULL is output as an empty string without - quotes, while an empty string data value is double-quoted - (""). Reading values follows similar rules. You can + PostgreSQL's COPY handles this by + quoting. A NULL is output as the NULL + parameter and is not quoted, while a non-NULL value matching the + the NULL parameter string is quoted. Therefore, using the default + settings, a NULL is written as an unquoted empty + string, while an empty string data value is written with double quotes + (""). Reading values follows similar rules. You can use FORCE NOT NULL to prevent NULL input comparisons for specific columns.