On 10/07/2013 03:06 PM, Robert Haas wrote:
>
>> Also if your use case is to treat empty strings as NULL (as per above
>> documentation), can't it be handled with "WITH NULL AS" option.
>> For example, something like:
>>
>> postgres=# COPY testnull FROM stdin with CSV NULL AS E'';
>> Enter data to be copied followed by a newline.
>> End with a backslash and a period on a line by itself.
>>>> 50,
>>>> \.
>> postgres=# select * from testnull;
>> a | b
>> ----+------
>> 50 | NULL
>> (1 row)
> Good point. If this patch is just implementing something that can
> already be done with another syntax, we don't need it.
>
Isn't the point of this option to allow a *quoted* empty string to be
forced to NULL? If so, this is not testing the same case - in fact the
COPY command above just makes explicit the default CSV NULL setting anyway.
cheers
andrew