Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id AFC64B5DBF5 for ; Thu, 13 Oct 2011 17:31:38 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 60684-08 for ; Thu, 13 Oct 2011 20:31:32 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from momjian.us (momjian.us [70.90.9.53]) by mail.postgresql.org (Postfix) with ESMTP id E3F37B5DBE3 for ; Thu, 13 Oct 2011 17:31:31 -0300 (ADT) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id p9DKVVM03514; Thu, 13 Oct 2011 16:31:31 -0400 (EDT) From: Bruce Momjian Message-Id: <201110132031.p9DKVVM03514@momjian.us> Subject: Re: BUG #6254: COPY ... TO .. CSV sometimes doesn't escape strings In-Reply-To: <201110131628.p9DGSFFf007210@wwwmaster.postgresql.org> To: Andrew Kerr Date: Thu, 13 Oct 2011 16:31:31 -0400 (EDT) CC: pgsql-bugs@postgresql.org X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201110/111 X-Sequence-Number: 31381 Andrew Kerr wrote: > > 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. Please show us an example. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. +