Re: multiline CSV fields - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: multiline CSV fields
Date
Msg-id 41AC9A64.4090102@dunslane.net
Whole thread Raw
In response to Re: multiline CSV fields  (Ben.Young@risk.sungard.com)
List pgsql-hackers

Ben.Young@risk.sungard.com wrote:

>
>I am normally more of a lurker on these lists, but I thought you had 
>better know 
>that when we developed CSV import/export for an application at my last 
>company
>we discovered that Excel can't always even read the CSV that _it_ has 
>output! 
>(With embedded newlines a particular problem) 
>  
>


Quite so.  This is not about being perfect, and there will be failures. 
But, absent this problem the feature should work reasonably well.

Note that Excel is not the only kid on the block - if it were there 
would be a good case for avoiding CSV anyway and instead reading/writing 
the excel files directly. We included support for CSVs because, 
nothwithstanding how braindead the format is, is is still widely used in 
data exchange.

>It is far more reliable if you output your data as an HTML table, in which 
>case it 
>practically always gets it right. Perhaps Postgres could support this as 
>an import/
>export mechanism as I have found it to be far less error prone than CSV?
>  
>

That's probably possibly but rather ugly. A well defined XML format 
would be far better (don't we have something like that in contrib?). 
Things for a bulk-export facility, I think.

cheers

andrew




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: 8.0beta5 results w/ dbt2
Next
From: Rod Taylor
Date:
Subject: Re: 8.0beta5 results w/ dbt2