Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bNwMb-0001Qx-EJ for pgsql-bugs@arkaria.postgresql.org; Fri, 15 Jul 2016 06:12:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bNwMa-0005H9-Jl for pgsql-bugs@arkaria.postgresql.org; Fri, 15 Jul 2016 06:12:40 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bNwMa-0005H2-2C for pgsql-bugs@postgresql.org; Fri, 15 Jul 2016 06:12:40 +0000 Received: from hogranch.com ([75.101.82.47]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bNwMX-00079A-Fh for pgsql-bugs@postgresql.org; Fri, 15 Jul 2016 06:12:38 +0000 Received: from [192.168.0.2] (porker [192.168.0.2]) by hogranch.com (8.11.6/8.11.6) with ESMTP id u6F6CUv18628 for ; Thu, 14 Jul 2016 23:12:30 -0700 Subject: Re: BUG #14251: COPY CSV: missing data for column that shouldn't be To: pgsql-bugs@postgresql.org References: <20160715020334.1425.78931@wrigleys.postgresql.org> From: John R Pierce Message-ID: <81b92ba9-0ef8-3b24-7c6c-6fca17c92655@hogranch.com> Date: Thu, 14 Jul 2016 23:12:26 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160715020334.1425.78931@wrigleys.postgresql.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-HawgScanner-Information: Please contact the ISP for more information X-HawgScanner: Found to be clean X-Pg-Spam-Score: -3.2 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 7/14/2016 7:03 PM, mickael.kerjean@gmail.com wrote: > "af,dekh"iykh'ya,Dekh"iykh'ya,13,,34.60345,69.2405" > => The csv is valid but postgres doesn't really get it right the quotes don't make much sense at all. country_code = "af city = dekh"iykh'ya city_accent = Dekh"iykh'ya region = 13 population = NULL lat = 34.60345 lng = 69.2405" is dekh"iykh'ya supposed to be accented characters or something? If you don't specify a QUOTE on your COPY command, it defaults to ", this will definitely mess things up. you might try specifying a QUOTE '%' or something that doesn't exist in your data, I don't think you can disable QUOTE entirely on CSV format copies. -- john r pierce, recycling bits in santa cruz -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs