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

From Amit Kapila
Subject Re: Patch: FORCE_NULL option for copy COPY in CSV mode
Date
Msg-id CAA4eK1+t6H3LZ18ofuVMbFhsyApp_LynnGm18fFc4jNyxrSXjw@mail.gmail.com
Whole thread Raw
In response to Re: Patch: FORCE_NULL option for copy COPY in CSV mode  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: Patch: FORCE_NULL option for copy COPY in CSV mode  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Thu, Oct 10, 2013 at 6:45 PM, Andrew Dunstan <andrew@dunslane.net> wrote:
>
> On 10/09/2013 11:47 PM, Amit Kapila wrote:
>>
>>
>>     One of the advantage, I could see using "NULL For .." syntax is
>> that already we have one syntax with which user can specify what
>> strings can be replaced with NULL, now just to handle quoted empty
>> string why to add different syntax.
>>
>> "FORCE_NULL" has advantage that it can be used for some columns rather
>> than all columns, but I think for that existing syntax can also be
>> modified to support it.
>>
>>
>>
>
>
> I think it's badly designed  on its face. We don't need and shouldn't
> provide a facility for different NULL markers. A general facility for that
> would be an ugly an quite pointless addition to code complexity. What we
> need is simply a way of altering one specific behaviour, namely the
> treatment of quoted NULL markers. We should not do that by allowing munging
> the NULL marker per column,
  I was thinking it to similar in some sense with "insert into tbl"
statement. For example  Create table tbl (c1 int, c2 int, c3 int, c4 int)  insert into tbl (col2) values(1);
  Here after table name, user can specify column names for which he
wants to provide specific values.

> but by a syntactical mechanism that directly
> addresses the change in behaviour. If you don't like "FORCE NULL" then let's
> pick something else, but not this ugly and unnecessary "NULL FOR" gadget.
  If you don't like idea of one generic syntax for NULLs in COPY
command, then "FORCE_QUOTED_NULL" or "QUOTED_NULL" will make more
sense as compare to FORCE_NULL.


With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Jaime Casanova
Date:
Subject: Re: [PoC] pgstattuple2: block sampling to reduce physical read
Next
From: Mark Kirkwood
Date:
Subject: Re: [PoC] pgstattuple2: block sampling to reduce physical read