Re: multiline CSV fields

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: multiline CSV fields
Date: 2004-11-29 13:27:48
Message-ID: 41AB23D4.6040509@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Bruce Momjian wrote:

>Tom Lane wrote:
>
>
>>Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
>>
>>
>>>Tom Lane wrote:
>>>
>>>
>>>>Which we do not have, because pg_dump doesn't use CSV. I do not think
>>>>this is a must-fix, especially not if the proposed fix introduces
>>>>inconsistencies elsewhere.
>>>>
>>>>
>>>Sure, pg_dump doesn't use it but COPY should be able to load anything it
>>>output.
>>>
>>>
>>I'd buy into that proposition if CSV showed any evidence of being a
>>sanely defined format, but it shows every indication of being neither
>>well-defined, nor self-consistent, nor even particularly portable.
>>I suggest adjusting your expectations. All I expect from that code is
>>being able to load the majority of data from the more popular Microsloth
>>applications. Trying to achieve 100% consistency for corner cases is
>>just going to interfere with the real use-case for the feature, which is
>>coping with output from applications that aren't very consistent in the
>>first place.
>>
>>
>
>OK, then should we disallow dumping out data in CVS format that we can't
>load? Seems like the least we should do for 8.0.
>
>
>

As Tom rightly points out, having data make the round trip was not the
goal of the exercise. Excel, for example, has no trouble reading such
data (or at least my installation of it).

Personally I consider CSVs with line end chars embedded in fields to be
broken anyway, but this was something that was specifically mentioned
when we were discussing requirements, which is why I coded for it.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-11-29 13:34:27 Re: multiline CSV fields
Previous Message Bruce Momjian 2004-11-29 13:13:56 Re: [pgsql-www] pg_autovacuum is nice ... but ...

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2004-11-29 13:34:27 Re: multiline CSV fields
Previous Message Bruce Momjian 2004-11-29 13:00:20 Re: multiline CSV fields