Re: Different length lines in COPY CSV

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Different length lines in COPY CSV
Date: 2005-12-12 04:55:49
Message-ID: 200512120455.jBC4tnh03411@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Christopher Kings-Lynne wrote:
> Hi,
>
> Is there any way to force COPY to accept that there will be lines of
> different length in a data file?
>
> I have a rather large file I'm trying to import. It's in CSV format,
> however, they leave off trailing empty columns on most lines.
>
> Any way to do this? Should it be supported by CSV mode?

No there is not, partly so we can complain that the file is corrupt, and
partly because we are unsure what to make the missing values, NULL?

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

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-12-12 05:42:25 Re: Different length lines in COPY CSV
Previous Message Christopher Kings-Lynne 2005-12-12 04:17:44 Different length lines in COPY CSV