Re: Different length lines in COPY CSV

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Different length lines in COPY CSV
Date: 2005-12-12 05:42:25
Message-ID: 22169.1134366145@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Christopher Kings-Lynne wrote:
>> Is there any way to force COPY to accept that there will be lines of
>> different length in a data file?

> I suppose we could have a TRAILINGNULL flag to COPY but because few ask
> for this feature, it hardly seems worth it.

There is no chance that we'll ever be able to cope with every insane
file format that some benighted program claims is CSV. The harder we
try, the more we will lose the ability to detect data errors at all;
not to mention the likely negative consequences for the readability
and performance of the COPY code. I think "fix it with a perl script"
is a very reasonable answer for cases like this one.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tino Wildenhain 2005-12-12 06:35:35 Re: Please Help: PostgreSQL Query Optimizer
Previous Message Bruce Momjian 2005-12-12 04:55:49 Re: Different length lines in COPY CSV