Re: COPY not handling csv files with quoted fiedls with embedded delimiters correctly - Mailing list pgsql-novice

From Tom Lane
Subject Re: COPY not handling csv files with quoted fiedls with embedded delimiters correctly
Date
Msg-id 18296.1229134794@sss.pgh.pa.us
Whole thread Raw
In response to COPY not handling csv files with quoted fiedls with embedded delimiters correctly  (Mary Anderson <maryfran@demog.berkeley.edu>)
List pgsql-novice
Mary Anderson <maryfran@demog.berkeley.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

pgsql-novice by date:

Previous
From: Mary Anderson
Date:
Subject: COPY not handling csv files with quoted fiedls with embedded delimiters correctly
Next
From: Bruce Hyatt
Date:
Subject: connection refused