Re: COPY formatting

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: andrew(at)dunslane(dot)net, tswan(at)idigx(dot)com
Subject: Re: COPY formatting
Date: 2004-03-19 19:07:29
Message-ID: 200403191107.29770.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thomas, Andrew, Karel,

Thomas is correct: many applications which read or make CSVs will accept a
newline if it is enclosed in a quote.

> > I *have* seen monstrosities like fields that do not begin with the quote
> > character but then break into a quote, e.g.:
> >
> > 1,2,a,123"abc""def",6,7,8

This I have never seen. It looks like a hackish error to me. What
application is it from?

Frankly, I would expect any CSV reader to error out on the above, and would be
annoyed if it did not.

Overall, I assert again that approaching this issue through COPY enhancements
is really not the way to go. We should be looking at a client utility,
like pg_import and pg_export. The primary purpose of COPY is bulk loads
for backup/restore, and I'm against doing a lot of tinkering which might make
it less efficient or introduce new issues into what's currently very
reliable.

--
-Josh Berkus
Aglio Database Solutions
San Francisco

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2004-03-19 21:14:15 Re: COPY formatting
Previous Message Bruce Momjian 2004-03-19 19:01:17 Re: COPY formatting