Re: plpgsql copy import csv double quotes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: PASCAL CROZET <pascal(dot)crozet(at)qualis-consulting(dot)com>
Cc: PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: plpgsql copy import csv double quotes
Date: 2019-10-09 22:31:17
Message-ID: 17097.1570660277@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

PASCAL CROZET <pascal(dot)crozet(at)qualis-consulting(dot)com> writes:
> I’ve experience issues with double quotes \34 inside fields, in a csv file.

> Ex :
> "value1","some text","other text with "double quotes" inside","last field"

I don't know of any definition of CSV format by which that's legal data.
The typical rule is that double quotes that are data must be doubled;
at least, that's what COPY expects by default. You can also get COPY
to handle variants like backslash-quote.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thiemo Kellner 2019-10-10 00:02:46 pgutils, pglogger and pgutilsL out
Previous Message Pól Ua Laoínecháin 2019-10-09 22:22:35 Re: Is my lecturer wrong about PostgreSQL? I think he is!