Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 39C551B25E4D for ; Thu, 15 Mar 2012 13:16:32 -0300 (ADT) Received: from mail-gy0-f174.google.com ([209.85.160.174]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S8DLr-0002qn-0U for pgsql-sql@postgresql.org; Thu, 15 Mar 2012 16:16:31 +0000 Received: by ghrr11 with SMTP id r11so3208638ghr.19 for ; Thu, 15 Mar 2012 09:16:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=PQ77SqqCQQ6sJ6JcusoS7gZIP5FddpEx5dCNfuCes2g=; b=ixt56T3oUzyu4sc4Oq9ovlMtTNvV6ReHOz3sa034dpi5j/yag9brfjDE19dhIOkCCV wqlbOy7Q8cKtkrHGPomAHXPUUAcEJhzpO+Qo2SRau9vv+sb/EH/YkC1S0T/2LlftinA6 zux0XarVsK/2v1xFB/gzhL/74bYLlba6/oVgW16SysOHpYrolHvFmKYjE82+7Ne0PuUC LspDqB2uzQoyna6WgIOLhyFozCEaBWy04ts405Imd/ynHlnXHFcX+Ggi8eI8NMl50LGA FDfI4gnIiyzXwiFiEBWrYFt1s+VtwQc7p7t7UW43kE6jDO+1lJy24pGfftR59vGxfsc6 qrSw== Received: by 10.224.116.18 with SMTP id k18mr8613919qaq.14.1331828178002; Thu, 15 Mar 2012 09:16:18 -0700 (PDT) Received: from [192.168.1.102] (207-237-122-16.c3-0.wsd-ubr1.qens-wsd.ny.cable.rcn.com. [207.237.122.16]) by mx.google.com with ESMTPS id ef6sm4853159qab.7.2012.03.15.09.16.16 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 15 Mar 2012 09:16:17 -0700 (PDT) Message-ID: <4F6215CE.7050207@gmail.com> Date: Thu, 15 Mar 2012 12:16:14 -0400 From: Lee Hachadoorian User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.27) Gecko/20120216 Thunderbird/3.1.19 MIME-Version: 1.0 To: "PostgreSQL (SQL)" Subject: COPY without quoting Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201203/45 X-Sequence-Number: 36440 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. But I am missing it if the COPY statement has a way to turn quotes off. You can turn them *on* with FORCE QUOTE, in which case a column will be quoted even if there are no embedded delimiters, etc. I tried COPY ... TO ... WITH CSV QUOTE ''; but got a message that the quote string had to be at least one character. Any ideas? Best, --Lee -- Lee Hachadoorian PhD, Earth& Environmental Sciences (Geography) Research Associate, CUNY Center for Urban Research http://freecity.commons.gc.cuny.edu