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 1iIJSj-0007RF-FP for pgsql-general@arkaria.postgresql.org; Wed, 09 Oct 2019 21:25:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iIJSh-0005X3-Tk for pgsql-general@arkaria.postgresql.org; Wed, 09 Oct 2019 21:25:35 +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 1iIJSg-0005Wr-Pr for pgsql-general@lists.postgresql.org; Wed, 09 Oct 2019 21:25:35 +0000 Received: from [66.111.4.25] (helo=out1-smtp.messagingengine.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iIJSc-0007r5-Nd for pgsql-general@postgresql.org; Wed, 09 Oct 2019 21:25:34 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 9C94722129; Wed, 9 Oct 2019 17:25:08 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 09 Oct 2019 17:25:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=1 pkLmv7BKVrgOYSWRxxUIy5PUPFRRKVOv4QL9uutxW8=; b=wJlZQYuIBoNFSHPcR X4oKrWStlBuiwlNreQbnI4CncbxS6YtGwWn4MsPfSdaoFanKErObW3iK9FYMzijd BLGOnhmE2m5ozuB32la7DLvSot3HfZZ0gjit1wAyCLmAYzLDtK3R2cLgmD5x8SxT Y0UdURJNHeOePo+W+TGMghpS8x2h1arr6VHvHe90QFE4xmoT6k6zYWg4K327CTn1 cg2Xb/K3IxKM78PqfRtIhN0U5rsO+UU/U9xNf4z1K8RbYbO7bp8GmbLvzim5LFVN kfRuuegIkbJpfdRY7SFQSe0UTU2yX/HJmtk4HY+1QbzMuiMua+E75ZJJyH25UveF /NMZQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=1pkLmv7BKVrgOYSWRxxUIy5PUPFRRKVOv4QL9uutx W8=; b=dMOVa2v9zoHJUeREADNryWbseyklK/HsVXxng8YlTPRiD1oSsfSHSASe/ HOjbyfEmEKKod4kdT+39RBDCd6LsQZ1sz+w//kv8tRHYOfOr9fFzFfPzuylpWFbd wJ2Dc8p28SBkFHaOYSjaBEvSmiyI3UClMPl1FNPditsugnV7j6elLNJG00giDYzu a8cD21P92kzIzWaDhKDmpqJn2yMSLgcIvkr6lVp2pq83YckjalU/Scw5qamPA3ER R1pC9QBWmyL7dt4vC1EWWBRwlvFJW0Hb+LI/P9oyqf/QMWKSfkCncl3mrih/fD3j 9BHvRd2QZvLnZUeM8yfRoEYeSKL7A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedriedugddufeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefheenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgpdhquhgrlhhishdqtgho nhhsuhhlthhinhhgrdgtohhmnecukfhppeejfedrvdefledruddujedrvdefkeenucfrrg hrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdr tghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from ranger.suse (c-73-239-117-238.hsd1.wa.comcast.net [73.239.117.238]) by mail.messagingengine.com (Postfix) with ESMTPA id 5FF6D8005C; Wed, 9 Oct 2019 17:25:07 -0400 (EDT) Subject: Re: plpgsql copy import csv double quotes To: PASCAL CROZET , PG-General Mailing List References: <453a8fd209f4444aacf7214b96c6eaa9@qualis-consulting.com> From: Adrian Klaver Message-ID: <127ce77c-c58d-f69a-dea2-8e7010f8fd4f@aklaver.com> Date: Wed, 9 Oct 2019 14:25:06 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: <453a8fd209f4444aacf7214b96c6eaa9@qualis-consulting.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 66.111.4.25 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 10/9/19 2:20 PM, PASCAL CROZET wrote: > Hi, MailingList > > PG 9.3 under Ubuntu 14.04 (I know, that’s obsolete, but we’re planning > to move to pg 10 or more during 2020) > > 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" > > When I import this line in a table, with the exact column number, with > the « copy » command in plpgslq, the import fails. What is the actual command? This is being done inside a plpgsql function, correct? If inside a function what is the function code? My guess is you need to use the CSV format to COPY: https://www.postgresql.org/docs/11/sql-copy.html > > Saying that too many fields are present. > > I tried to catch the double quotes and delete then, but that’s hard > under AWK or sed > > *_________________________________* > > Cordialement, *Pascal CROZET* > > *DBA - *Qualis Consulting > > > •www.qualis-consulting.com •04 78 22 > 74 90 > •Le Bois des Côtes 1 – Bâtiment A > •300 Route Nationale 6 – 69760 LIMONEST > *_________________________________* > > GRANT and REVOKE trigger on a ddl_command_end event trigger 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. 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 lower case names like 'table' for all other event types? > > > Thanks, > > Miles Elam > -- Adrian Klaver adrian.klaver@aklaver.com