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 1iIKUO-0001Kx-4K for pgsql-general@arkaria.postgresql.org; Wed, 09 Oct 2019 22:31:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iIKUM-0008Ls-Qd for pgsql-general@arkaria.postgresql.org; Wed, 09 Oct 2019 22:31:22 +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 1iIKUM-0008Ll-H0 for pgsql-general@lists.postgresql.org; Wed, 09 Oct 2019 22:31:22 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iIKUK-00005V-3w for pgsql-general@postgresql.org; Wed, 09 Oct 2019 22:31:22 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x99MVHm5017098; Wed, 9 Oct 2019 18:31:17 -0400 From: Tom Lane To: PASCAL CROZET cc: PG-General Mailing List Subject: Re: plpgsql copy import csv double quotes In-reply-to: <453a8fd209f4444aacf7214b96c6eaa9@qualis-consulting.com> References: <453a8fd209f4444aacf7214b96c6eaa9@qualis-consulting.com> Comments: In-reply-to PASCAL CROZET message dated "Wed, 09 Oct 2019 21:20:02 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <17096.1570660277.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Wed, 09 Oct 2019 18:31:17 -0400 Message-ID: <17097.1570660277@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PASCAL CROZET 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