diff --git a/doc/src/sgml/ref/copy.sgml b/doc/src/sgml/ref/copy.sgml index 23a3ef0b9b6..e4513a3567c 100644 --- a/doc/src/sgml/ref/copy.sgml +++ b/doc/src/sgml/ref/copy.sgml @@ -1,5 +1,5 @@ @@ -183,8 +183,8 @@ COPY { tablename [ ( The string that represents a null value. The default is - \N (backslash-N) in text mode, and a empty - value with no quotes in CSV mode. You might prefer an + \N (backslash-N) in text mode, and an unquoted empty + string in CSV mode. You might prefer an empty string even in text mode for cases where you don't want to distinguish nulls from empty strings. @@ -298,6 +298,10 @@ COPY count somewhat faster than the normal text mode, but a binary-format file is less portable across machine architectures and PostgreSQL versions. + Also, the binary format is very data type specific; for example + it will not work to output binary data from a smallint column + and read it into an integer column, even though that would work + fine in text format. @@ -544,11 +548,11 @@ COPY count The CSV format has no standard way to distinguish a NULL value from an empty string. - 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 + PostgreSQL's COPY handles this by quoting. + A NULL is output as the NULL parameter string + and is not quoted, while a non-NULL value matching the + NULL parameter string is quoted. For example, with 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