Re: delimeters psql /CSV

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: paul(dot)malm(at)lfv(dot)se
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: delimeters psql /CSV
Date: 2019-06-07 12:02:37
Message-ID: e1098c2d-1f95-4d7a-9cd1-2bf92a81d0ac@manitou-mail.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message paul.malm 2019-06-07 12:30:25 SV: delimeters psql /CSV
Previous Message Ict Security 2019-06-07 11:58:04 Strange connection limit problem