Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 36E94B5DC01 for ; Thu, 13 Oct 2011 13:28:17 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 74613-01 for ; Thu, 13 Oct 2011 16:28:17 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by mail.postgresql.org (Postfix) with ESMTP id 7B7B4B5DBDE for ; Thu, 13 Oct 2011 13:28:16 -0300 (ADT) Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by wwwmaster.postgresql.org (8.14.3/8.14.3) with ESMTP id p9DGSFQw007211 for ; Thu, 13 Oct 2011 16:28:15 GMT (envelope-from www@wwwmaster.postgresql.org) Received: (from www@localhost) by wwwmaster.postgresql.org (8.14.3/8.14.3/Submit) id p9DGSFFf007210; Thu, 13 Oct 2011 16:28:15 GMT (envelope-from www) Date: Thu, 13 Oct 2011 16:28:15 GMT Message-Id: <201110131628.p9DGSFFf007210@wwwmaster.postgresql.org> To: pgsql-bugs@postgresql.org Subject: BUG #6254: COPY ... TO .. CSV sometimes doesn't escape strings From: "Andrew Kerr" Content-Type: text/plain; charset=utf-8 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 201110/110 X-Sequence-Number: 31380 The following bug has been logged online: Bug reference: 6254 Logged by: Andrew Kerr Email address: andrew.kerr@unrulymedia.com PostgreSQL version: 9.0.5 Operating system: CentOS 5.4 Description: COPY ... TO .. CSV sometimes doesn't escape strings Details: Query of this form: copy (select col1,col2 from mytable) to 'output.csv' with (format csv, force_quote *); where some selected columns are text sometimes fails to escape quotes (with another quote) in text. On which rows this happens varies with different runs. Sometimes a field will have some quotes escaped and some not. Running on a 90 million row table.