]> granicus.if.org Git - postgresql/commit
Provide a FORCE NULL option to COPY in CSV mode.
authorAndrew Dunstan <andrew@dunslane.net>
Tue, 4 Mar 2014 22:31:59 +0000 (17:31 -0500)
committerAndrew Dunstan <andrew@dunslane.net>
Tue, 4 Mar 2014 22:31:59 +0000 (17:31 -0500)
commit3b5e03dca2afea7a2c12dbc8605175d0568b5555
tree4fadb752688feee0a0c08273f0bbb857e5fce429
parente2a0fc5363e293d29053d0582a1009bc9fef0276
Provide a FORCE NULL option to COPY in CSV mode.

This forces an input field containing the quoted null string to be
returned as a NULL. Without this option, only unquoted null strings
behave this way. This helps where some CSV producers insist on quoting
every field, whether or not it is needed. The option takes a list of
fields, and only applies to those columns. There is an equivalent
column-level option added to file_fdw.

Ian Barwick, with some tweaking by Andrew Dunstan, reviewed by Payal
Singh.
contrib/file_fdw/data/text.csv
contrib/file_fdw/file_fdw.c
contrib/file_fdw/input/file_fdw.source
contrib/file_fdw/output/file_fdw.source
doc/src/sgml/file-fdw.sgml
doc/src/sgml/ref/copy.sgml
src/backend/commands/copy.c
src/backend/parser/gram.y
src/test/regress/expected/copy2.out
src/test/regress/sql/copy2.sql