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 1nR8p4-0003db-Os for pgsql-sql@arkaria.postgresql.org; Mon, 07 Mar 2022 08:34:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nR8p3-0000Xh-4w for pgsql-sql@arkaria.postgresql.org; Mon, 07 Mar 2022 08:34:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nR2ew-0007PI-1N for pgsql-sql@lists.postgresql.org; Mon, 07 Mar 2022 01:59:38 +0000 Received: from mail-qk1-x730.google.com ([2607:f8b0:4864:20::730]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nR2et-0003v0-OT for pgsql-sql@lists.postgresql.org; Mon, 07 Mar 2022 01:59:37 +0000 Received: by mail-qk1-x730.google.com with SMTP id b13so10838093qkj.12 for ; Sun, 06 Mar 2022 17:59:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:message-id:subject:reply-to:to:date:organization :user-agent:mime-version:content-transfer-encoding; bh=dDAIg2mS/ZbFJpgkR2ddvPKI2F4G7Dcot1mqcs7DFe4=; b=Z4sfM5Qm0XUn57jFiEx8Dc21dOK5OZZFlO4IMSVZbk9cSO3BONIxwquUbQoZHTEmSZ 176djsMmI24fCqGOp5dEQOrcN0pkyZ6zh5l+264m0lmal6pfzUblGvoKI8LE0epyO5Wz 1crpISlS1Typbt3pBSs/eDQKzoUlXFLke2Hr+LrdVs92zIjINGrj/4CRYYEJtz5WaSF+ Y+euXWC6U4wv3u6nr4WbXyhXS32mikNdgKnwyabu/bs/5gHpeAyrjx6juBrq8uIQrqc6 +KUi3uz/o74iQbLkzieErGRDf8jS1Px3hkRpamw/acTDKXYJmq/N3l6RTzhdWm1Lm3h+ x/4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:message-id:subject:reply-to:to:date :organization:user-agent:mime-version:content-transfer-encoding; bh=dDAIg2mS/ZbFJpgkR2ddvPKI2F4G7Dcot1mqcs7DFe4=; b=zaTWkGFyM+o8KaT/ZKVlUc40xHCP6EAKhpVt/axO4AwAIDGliGlGE0QapNtTDpHlBI LAvdXMb5S+AcBHmaPXBr9YV//EVR21+JxZ9xVYgvGuIDlhfiiBGzmwrB6/eGxepPqU9L Q0qINCl1wBQd3AC2bgq4M4uNbYlLro2VYf2XTgI3mkvG8EkzdwJUxCFyf+yn6VTGL1NU LaAIOdpHB5mhOuN41OOilUjVMMbwha2FXrLT+I2azUV719HDdz/w7p+Zthl4ZNIRAJCJ DZVrFWWzLsZiy6VTuqdKfmtKr+7rUICxznh5cZ/fkQJLkScgj4+nHuuEFpE/Z3tHLQSZ yfqw== X-Gm-Message-State: AOAM531lku1P/BE2CsIy8FpLL32p9C5IAJl7iUTBhmmh5q+P9EcuIIpT dhuf+umZRB89r6VPQEyWTCFMEKZYQ8Y= X-Google-Smtp-Source: ABdhPJwAKf8iii+3CUBSxclE0uTHMjuq43UA0K5ECTluiFtGllYM5LSI1ITKNAyGNpGdlAtuyhKveA== X-Received: by 2002:a37:af81:0:b0:5f1:9172:7c3f with SMTP id y123-20020a37af81000000b005f191727c3fmr5745909qke.665.1646618373526; Sun, 06 Mar 2022 17:59:33 -0800 (PST) Received: from [10.200.0.6] ([45.132.227.62]) by smtp.gmail.com with ESMTPSA id w9-20020ac87e89000000b002e039503dc7sm7854992qtj.18.2022.03.06.17.59.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Mar 2022 17:59:33 -0800 (PST) Sender: Scott Macri From: Scott Macri X-Google-Original-From: Scott Macri Message-ID: <775429fc5428ca2640f72f1d29f6e8ec90955e6c.camel@gmail.com> Subject: ERROR: extra data after last expected column Reply-To: Scott@BITSnBYTES.io To: pgsql-sql@lists.postgresql.org Date: Sun, 06 Mar 2022 20:59:31 -0500 Organization: BITSnBYTES Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (by Flathub.org)) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I'm trying to use the postgres copy command and getting, "extra data after last expected column". All items in the DB are currently set to varchar(255) to make it simple. I've checked for hidden characters in the file and don't see any. All the other files I've processed with this exact command worked perfectly. I've processed 10 other's so far. The only difference I notice is this one has significantly more columns. The number of columns in the DB (25) exactly match the number of columns in the csv (25), which exactly match the number of columns defined in my COPY command (25). I've read practically every post on the internet over the last two days containg this error and cannot resolve it. I am completely stumped at this point. 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'); 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|..." Any help or advice would be greatly appreciated. Thank you very much. -- Hacktorious