Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hZDa9-00071o-Oo for pgsql-general@arkaria.postgresql.org; Fri, 07 Jun 2019 12:02:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hZDa8-0004wP-50 for pgsql-general@arkaria.postgresql.org; Fri, 07 Jun 2019 12:02:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hZDa7-0004wE-RL for pgsql-general@lists.postgresql.org; Fri, 07 Jun 2019 12:02:51 +0000 Received: from mail.verite.pro ([185.16.44.216]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hZDa0-0007oI-2Z for pgsql-general@lists.postgresql.org; Fri, 07 Jun 2019 12:02:51 +0000 Received: from genius-map.net (verite.pro [195.154.189.246]) by mail.verite.pro (Postfix) with ESMTP id 5E3F08C0232; Fri, 7 Jun 2019 13:56:55 +0200 (CEST) Received: by genius-map.net (Postfix, from userid 1001) id 2C0AA38A07F5; Fri, 7 Jun 2019 14:02:40 +0200 (CEST) Content-Type: text/plain; charset="iso-8859-15" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: delimeters psql /CSV From: "Daniel Verite" To: paul.malm@lfv.se Cc: pgsql-general@lists.postgresql.org In-Reply-To: <785199B14156764C8EB14EF96CEDC44EE041CA@xw-exch03.lfv.se> Date: Fri, 07 Jun 2019 14:02:37 +0200 Message-Id: X-Mailer: Manitou v1.7.3 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Paul Malm wrote: > C:\Users\an\bin>C:\Tmp\psql -h 10.211.43.22 -p 5432 -U postgres -d aatest= -w > -c "\copy public.""Bayern"" FROM 'C:\Users\an\test\Bayern.csv' WITH > DELIMITER ';' CSV" > Error: extra data after expected last column > CONTEXT: COPY Bayern, row 1: > "48.455555555555556;11.800833333333333;Anglberg/Amper;Industrial > plant;722;220;220;2133;0;0;Undefined..." >=20 > I have a table (Bayern) with all columns in the right format. There is a > column-value which has a '/' in the string (Anglberg/Amper). I think that > '/' is taken for a delimeter, since when I replace / with 'white space' it > works. There's no reason for '/' to be taken as a delimiter. Can you can share the table definition and the offending line as an attachment, so that someone can try to reproduce this with the exact same data? Also mention your PostgreSQL version and the shell the command is invoked from (cmd.exe, powershell, something else?) just in case it matters. Best regards, --=20 Daniel V=E9rit=E9 PostgreSQL-powered mailer: http://www.manitou-mail.org Twitter: @DanielVerite