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 1iIJNT-0007GP-HN for pgsql-general@arkaria.postgresql.org; Wed, 09 Oct 2019 21:20:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iIJNQ-00028M-MW for pgsql-general@arkaria.postgresql.org; Wed, 09 Oct 2019 21:20:08 +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 1iIJNQ-000289-CJ for pgsql-general@lists.postgresql.org; Wed, 09 Oct 2019 21:20:08 +0000 Received: from smtpout12.r2.mail-out.ovh.net ([54.36.141.12]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iIJNN-0007nu-5y for pgsql-general@postgresql.org; Wed, 09 Oct 2019 21:20:07 +0000 Received: from ex2.mail.ovh.net (unknown [10.109.146.142]) by mo512.mail-out.ovh.net (Postfix) with ESMTPS id 9BE3EA91F652 for ; Wed, 9 Oct 2019 23:20:03 +0200 (CEST) Received: from EX12.indiv2.local (172.16.2.12) by EX11.indiv2.local (172.16.2.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1466.3; Wed, 9 Oct 2019 23:20:03 +0200 Received: from EX12.indiv2.local ([fe80::4166:c67a:56f6:c34a]) by EX12.indiv2.local ([fe80::4166:c67a:56f6:c34a%12]) with mapi id 15.01.1466.008; Wed, 9 Oct 2019 23:20:03 +0200 From: PASCAL CROZET To: PG-General Mailing List Subject: plpgsql copy import csv double quotes Thread-Topic: plpgsql copy import csv double quotes Thread-Index: AQHVfuZNp4E1BME9HUeRL79RyFsDaQ== Date: Wed, 9 Oct 2019 21:20:02 +0000 Message-ID: <453a8fd209f4444aacf7214b96c6eaa9@qualis-consulting.com> Accept-Language: fr-FR, en-US Content-Language: fr-FR X-MS-Has-Attach: yes X-MS-TNEF-Correlator: Content-Type: multipart/related; boundary="_004_453a8fd209f4444aacf7214b96c6eaa9qualisconsultingcom_"; type="multipart/alternative" MIME-Version: 1.0 X-Ovh-Tracer-Id: 5693394356106078396 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedriedugddufeekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --_004_453a8fd209f4444aacf7214b96c6eaa9qualisconsultingcom_ Content-Type: multipart/alternative; boundary="_000_453a8fd209f4444aacf7214b96c6eaa9qualisconsultingcom_" --_000_453a8fd209f4444aacf7214b96c6eaa9qualisconsultingcom_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Hi, MailingList PG 9.3 under Ubuntu 14.04 (I know, that=92s obsolete, but we=92re planning = to move to pg 10 or more during 2020) I=92ve experience issues with double quotes \34 inside fields, in a csv fil= e. Ex : "value1","some text","other text with "double quotes" inside","last field" When I import this line in a table, with the exact column number, with the = =AB copy =BB command in plpgslq, the import fails. Saying that too many fields are present. I tried to catch the double quotes and delete then, but that=92s hard under= AWK or sed _________________________________ Cordialement, Pascal CROZET DBA - [cid:image002.png@01D57EF8.10B0A960] Qualis Consulting =95 www.qualis-consulting.com =95 04 78 = 22 74 90 =95 Le Bois des C=F4tes 1 =96 B=E2timent A =95 300 Route Nationale 6 =96 69760 LIMONEST _________________________________ GRANT and REVOKE trigger on a ddl_command_end event trigger but don't provi= de any information beyond whether it was a table, schema, function, etc. th= at was affected. No object IDs or the like are included. How would you find= out which table had its ACLs modified? Also, why do grants and revokes have an object_type of 'TABLE' instead of l= ower case names like 'table' for all other event types? Thanks, Miles Elam --_000_453a8fd209f4444aacf7214b96c6eaa9qualisconsultingcom_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable

Hi, MailingList

 

PG 9.3 under Ubuntu 14.04 (I know, that=92s obsolete= , but we=92re planning to move to pg 10 or more during 2020)

I=92ve experience issues with double quotes \34 insi= de fields, in a csv file.

 

Ex :

"value1","some text","other= text with "double quotes" inside","last field"

 

When I import this line in a table, with the exact c= olumn number, with the =AB copy =BB command in plpgslq, the impor= t fails.

Saying that too many fields are present. 

 

I tried to catch the double quotes and de= lete then, but that=92s hard under AWK or sed

_________________________________

Cordialement, Pascal CROZET

DBA - <= /span><= a href=3D"http://www.qualis-consulting.com">Qualis Consulting

=95 www.qualis-consulting.com<= /span> =95 04 78 22 74 90
=95 Le Bois des C= =F4tes 1 =96 B=E2timent A
=95 300 Route Nati= onale 6 =96 69760 LIMONEST
_________________________________

GRANT and REVOKE trigger on a ddl_command_end event trigge= r but don't provide any information beyond whether it was a table, schema, = function, etc. that was affected. No object IDs or the like are included. H= ow would you find out which table had its ACLs modified?

Also, why do grants and revokes have an object_type of 'TABLE' instead= of lower case names like 'table' for all other event types?


Thanks,

Miles Elam

--_000_453a8fd209f4444aacf7214b96c6eaa9qualisconsultingcom_-- --_004_453a8fd209f4444aacf7214b96c6eaa9qualisconsultingcom_ Content-Type: image/png; name="31586B64B20C4E70AA403455AA402C62.png" Content-Description: 31586B64B20C4E70AA403455AA402C62.png Content-Disposition: inline; filename="31586B64B20C4E70AA403455AA402C62.png"; size=150; creation-date="Wed, 09 Oct 2019 21:20:02 GMT"; modification-date="Wed, 09 Oct 2019 21:20:02 GMT" Content-ID: Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAAIsAAAAlCAYAAAByDxphAAAAAXNSR0IArs4c6QAAAARnQU1BAACx jwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAArSURBVHhe7cEBDQAAAMKg909tDwcEAAAAAAAA AAAAAAAAAAAAAAAAALyrAVCBAAEpi4pKAAAAAElFTkSuQmCC --_004_453a8fd209f4444aacf7214b96c6eaa9qualisconsultingcom_--