Attached is a proof-of-concept patch (i.e. not intended for application
just yet) to fix the problem of parsing CSV multiline fields.
Originally I indicated that the way to solve this IMHO was to the
combine reading and parsing phases of COPY for CSV. However, there's a
lot going on there and I adopted a somewhat less invasive approach,
which detects if a CR and/orNL should be part of a data value and if so
treats it as just another character. Also, it removes the escaping
nature of backslash for NL and CR in CSV, which is clearly a bug.
One thing I noticed is that (unless I misread the code) our standard
detection of the end marker \.<EOL> doesn't seem to require that it be
at the beginning of a line, as the docs say it should. I didn't change
that but did build a test for it into the special CSV code.
pgsql-patches by date
|Next:||From: Neil Conway||Date: 2005-02-07 05:55:37|
|Subject: Re: WIP: pl/pgsql cleanup|
|Previous:||From: Bruce Momjian||Date: 2005-02-05 23:51:52|
|Subject: Re: libpq API incompatibility between 7.4 and 8.0|