Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nROtk-0005Iq-0V for pgsql-general@arkaria.postgresql.org; Tue, 08 Mar 2022 01:44:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nROti-0004Gr-U5 for pgsql-general@arkaria.postgresql.org; Tue, 08 Mar 2022 01:44:22 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nROsB-0006lF-OZ for pgsql-general@lists.postgresql.org; Tue, 08 Mar 2022 01:42:47 +0000 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nROs9-0002n8-Dq for pgsql-general@lists.postgresql.org; Tue, 08 Mar 2022 01:42:46 +0000 Received: by mail-oi1-x230.google.com with SMTP id z7so17355161oid.4 for ; Mon, 07 Mar 2022 17:42:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to; bh=/8eKCUTEns5teozP3D+Ju/299WmQikSlMgfuOYyXGWI=; b=C86w17I2Cky2ZiS0vJOJyI5B3Lihn6xZucllLPjpLGDz/c1M+uEcXoUnQZXnqW2JkQ mzlFKqwbk+Q1veGyRvZ8jWj/nAucwuSldRlWJSy93U1nX1aoKqHuG9DfoaSQuOM8c9JY uN2QMY6u3HjSdFuDwECGzBgjkePVRv3pMQ/wTds3viw7vDk/QuzdF4I9yG0wVrukATHb g6E7dyjDTBE6fGLzavv92PrcK/aPNjlkg3JY1BJEsA25NpTgI/mTM0IG3F8KaKY4kTua lw+uEQzVTyIKhEuWMeb+/UxCspevWQ7lmROeX5xOUZVx7HAfaySCedQaUrMfi2peIiUA nLUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to; bh=/8eKCUTEns5teozP3D+Ju/299WmQikSlMgfuOYyXGWI=; b=pgGpVFi9bUqWnrNh473jpCqHWh98iOPUWi5HgOga+VKHJsIDZLMgfP+jSAVYwJiqN/ 10L+cTfI7YY0XnQGE3imUfy+U3ojGxpRfGHuzA2tGX2KbAMccskGbfYxkJ1o26WDdVTE L47a7i4uk8sB2N9sGkXTm+xj6rXkz2rvPgRDLtMAQv3cE3y0gIOXWOrq6yCFmD4dbrod ecsiwgFA2ONjMm5rM8M5YUMuP8NqlEIoayqiiMgpt8YyAGCbegs1k6omJjshWYeTNqPG LZwrC3x7k4DNUezKaqSlRTobb87vk9gkJq0TwfG5kUp/XgwAgpYJVzB6WRP4KhTiW1mM PHJw== X-Gm-Message-State: AOAM533Hq5ssEic04dmYLGJpzMd7VKBaHFh6PCAJUdTMDSuIJ6jckVHQ S5J8Ou7j74mFFn9jb0AsXjBRFdfAsWM= X-Google-Smtp-Source: ABdhPJx+lWbj9ttYG/RuiCjnLKkl/YTTx4HD9oJUIjQBvTKShNYR8bXVrMXq/ikS5HZH7B/XZ22v5g== X-Received: by 2002:a05:6808:128b:b0:2d9:a01a:4b9c with SMTP id a11-20020a056808128b00b002d9a01a4b9cmr1225880oiw.195.1646703764586; Mon, 07 Mar 2022 17:42:44 -0800 (PST) Received: from [192.168.88.10] (ip68-11-68-85.no.no.cox.net. [68.11.68.85]) by smtp.googlemail.com with ESMTPSA id m66-20020aca3f45000000b002da0aa04eafsm590261oia.30.2022.03.07.17.42.43 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Mar 2022 17:42:44 -0800 (PST) Content-Type: multipart/alternative; boundary="------------gzf0jrP8Qk1vS0gJQQ0u0vrf" Message-ID: <1ed6d66d-0caa-36bb-21f5-df39adaa26e4@gmail.com> Date: Mon, 7 Mar 2022 19:42:43 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: ERROR: extra data after last expected column Content-Language: en-US To: pgsql-general@lists.postgresql.org References: <775429fc5428ca2640f72f1d29f6e8ec90955e6c.camel@gmail.com> <095fbaeb-9c9e-1c8f-42bd-d1e75eb81eb5@gmail.com> From: Ron In-Reply-To: <095fbaeb-9c9e-1c8f-42bd-d1e75eb81eb5@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------gzf0jrP8Qk1vS0gJQQ0u0vrf Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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. --------------gzf0jrP8Qk1vS0gJQQ0u0vrf Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit 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.
--------------gzf0jrP8Qk1vS0gJQQ0u0vrf--