Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 9A75E1B25E4F for ; Thu, 15 Mar 2012 13:23:53 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S8DSv-0007t0-0d for pgsql-sql@postgresql.org; Thu, 15 Mar 2012 16:23:52 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id q2FGNYXQ021645; Thu, 15 Mar 2012 12:23:35 -0400 (EDT) To: Lee Hachadoorian cc: "PostgreSQL (SQL)" Subject: Re: COPY without quoting In-reply-to: <4F6215CE.7050207@gmail.com> References: <4F6215CE.7050207@gmail.com> Comments: In-reply-to Lee Hachadoorian message dated "Thu, 15 Mar 2012 12:16:14 -0400" Date: Thu, 15 Mar 2012 12:23:34 -0400 Message-ID: <21644.1331828614@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201203/46 X-Sequence-Number: 36441 Lee Hachadoorian writes: > COPY ... TO ... WITH CSV defaults to quoting string fields with embedded > delimiters, quotes, and newlines. In pgAdmin I can execute to file and > specify "no quoting" for the output, in which case I get (what I want) a > file with no quotes, even though there are embedded commas in the > strings. Uh ... why exactly would you want that? It seems impossible to parse such a file. If what you want is an unparsable file, you could just strip out the quotes with "sed" after the fact. But COPY is not in the business of producing non-machine-readable files, so the fact that it doesn't have an option for this doesn't bother me. regards, tom lane