From: Daniel Verite <daniel@manitou-mail.org>
To: paul.malm@lfv.se
Cc: pgsql-general@lists.postgresql.org
Subject: Re: delimeters psql /CSV
Date: Fri, 07 Jun 2019 14:02:37 +0200
Message-ID: <e1098c2d-1f95-4d7a-9cd1-2bf92a81d0ac@manitou-mail.org> (raw)
In-Reply-To: <785199B14156764C8EB14EF96CEDC44EE041CA@xw-exch03.lfv.se>
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..."
>
> 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,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: daniel@manitou-mail.org, paul.malm@lfv.se
Subject: Re: delimeters psql /CSV
In-Reply-To: <e1098c2d-1f95-4d7a-9cd1-2bf92a81d0ac@manitou-mail.org>
References: <785199B14156764C8EB14EF96CEDC44EE041CA@xw-exch03.lfv.se> <e1098c2d-1f95-4d7a-9cd1-2bf92a81d0ac@manitou-mail.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox