Re: COPY not handling csv files with quoted fiedls with embedded delimiters correctly

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mary Anderson <maryfran(at)demog(dot)berkeley(dot)edu>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: COPY not handling csv files with quoted fiedls with embedded delimiters correctly
Date: 2008-12-13 02:19:54
Message-ID: 18296.1229134794@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Mary Anderson <maryfran(at)demog(dot)berkeley(dot)edu> writes:
> Command:

> COPY input.input_file_m105 (test_date,deaths_)
> FROM '/home/maryfran/memdev/DATA/DATES/Mmmm_ddCOMMA_yyyy.txt'
> WITH CSV HEADER

> File:

> test_date,deaths /* this is
> first line of file*/
> "January 3, 1999","123"

> Error message:

> ERROR: extra data after last expected column CONTEXT: COPY
> input_file_m105, line 2: "January 3, 1999,123"

Maybe you aren't reading the same file you think you are? Because
the error message says that there are no quotes on the line that the
backend saw.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Bruce Hyatt 2008-12-13 03:40:17 connection refused
Previous Message Mary Anderson 2008-12-13 00:38:31 COPY not handling csv files with quoted fiedls with embedded delimiters correctly