Re: ERROR: extra data after last expected column

From: Ron <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: ERROR: extra data after last expected column
Date: 2022-03-08 01:42:43
Message-ID: 1ed6d66d-0caa-36bb-21f5-df39adaa26e4@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

On 3/7/22 17:57, Rob Sargent wrote:
> On 3/7/22 16:48, scott macri wrote:
[snip]
>>
>>>> It pukes after the 9th column every time no matter what I
>>>> change.
>>>>
>>>> COPY
>>>> option_details(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y)
>>>> FROM '/home/dump/my_csv.csv' WITH (FORMAT CSV, DELIMITER
>>>> '|', ENCODING
>>>> 'UTF8');
>>>>
>> You've verified the encoding is UTF8?
>>
>>>> Row one data in file is below:
>>>> item a | item b | item c | item d | item e | item f | item
>>>> g | item h |
>>>> item i | item j | item k | item l | item m | item n | item
>>>> o | item p |
>>>> item q | item r | item s | item t | item u | item v | item
>>>> w | item x |
>>>> item y
>>>> --- Line two would normally start here but no reason to
>>>> show since it's
>>>> failing above. ---
>>>>
>>>> I get the following error:
>>>> ERROR:  extra data after last expected column
>>>> CONTEXT:  COPY option_details, line 1: "item a|item b|item
>>>> c|item
>>>> d|item e|item f|item g|item h|item i|..."
>>>>

Might there be pipe characters in one of the columns?

--
Angular momentum makes the world go 'round.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Macri 2022-03-08 01:51:06 Re: ERROR: extra data after last expected column
Previous Message Scott Macri 2022-03-08 01:40:54 Re: ERROR: extra data after last expected column

Browse pgsql-sql by date

  From Date Subject
Next Message Scott Macri 2022-03-08 01:51:06 Re: ERROR: extra data after last expected column
Previous Message Scott Macri 2022-03-08 01:40:54 Re: ERROR: extra data after last expected column