Re: Review: Patch FORCE_NULL option for copy COPY in CSV mode - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Review: Patch FORCE_NULL option for copy COPY in CSV mode
Date
Msg-id 3732.1394032188@sss.pgh.pa.us
Whole thread Raw
In response to Re: Review: Patch FORCE_NULL option for copy COPY in CSV mode  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: Review: Patch FORCE_NULL option for copy COPY in CSV mode
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> On 03/05/2014 09:11 AM, Michael Paquier wrote:
>> After testing this feature, I noticed that FORCE_NULL and
>> FORCE_NOT_NULL can both be specified with COPY on the same column.

> Strictly they are not actually contradictory, since FORCE NULL relates 
> to quoted null strings and FORCE NOT NULL relates to unquoted null 
> strings. Arguably the docs are slightly loose on this point. Still, 
> applying both FORCE NULL and FORCE NOT NULL to the same column would be 
> rather perverse, since it would result in a quoted null string becoming 
> null and an unquoted null string becoming not null.

Given the remarkable lack of standardization of "CSV" output, who's
to say that there might not be data sources out there for which this
is the desired behavior?  It's weird, I agree, but I think throwing
an error for the combination is not going to be helpful.  It's not
like somebody might accidentally write both on the same column.

+1 for clarifying the docs, though, more or less in the words you
used above.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Fwd: patch: make_timestamp function
Next
From: Merlin Moncure
Date:
Subject: Re: jsonb and nested hstore