Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id C33D31B25E4D for ; Thu, 15 Mar 2012 13:53:09 -0300 (ADT) Received: from mail-ey0-f174.google.com ([209.85.215.174]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S8DvF-0003QH-68 for pgsql-sql@postgresql.org; Thu, 15 Mar 2012 16:53:09 +0000 Received: by eaaq12 with SMTP id q12so1729594eaa.19 for ; Thu, 15 Mar 2012 09:52:52 -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:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=C4vONDCOqzn6H0vmw/k0pnz4BKGmo8R7YSM9La2FWco=; b=AqNpYI9dQMKwtraqccGbvUL8RAdjUTQaQs2nCCu5/cG/gn570XWIkuO2BeGD//s8ZT VinrrJGEyug4658GmmAIhVGZIKdPEW5AH6EHKYezE1zUaqiyvzoG6T32O4tRJPRAeBYV s2o8QYQK3YAc/HwXu3xqXOc8ZeH4vean2pf0M6/nXhre6vn+2+aM4qYNzWZxs5DEAlpF 9gAih4zlu2vGs2v5cJIr7DrFO6i7DCwOHw1wjuLDRdeWmp9orDQckNVwys7ZCI8UCJ7z rHrEWWDULreKRM2dpPgdQgVI6fIUkpdKgRk8zmvFQ9xI0jSnTgn/hr1X8pF44LXbUg8e 1AyQ== Received: by 10.229.135.11 with SMTP id l11mr2565719qct.140.1331830368935; Thu, 15 Mar 2012 09:52:48 -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 i19sm4987388qad.19.2012.03.15.09.52.47 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 15 Mar 2012 09:52:48 -0700 (PDT) Message-ID: <4F621E5D.2050206@gmail.com> Date: Thu, 15 Mar 2012 12:52:45 -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: Tom Lane CC: "PostgreSQL (SQL)" Subject: Re: COPY without quoting References: <4F6215CE.7050207@gmail.com> <21644.1331828614@sss.pgh.pa.us> In-Reply-To: <21644.1331828614@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201203/47 X-Sequence-Number: 36442 On 03/15/2012 12:23 PM, Tom Lane wrote: > 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. > Admittedly, it's a hack, but I'm using array_to_string(..., ',') to concatenate several array columns which contain fairly long arrays. Strip out the quotes, and you do have a parsable CSV, with each array element becoming a column. Your next question is probably why would I want to do *that*. Based on previous responses from this list, I use array columns to store the 32,000 column US Census American Community Survey data set. Stripping out quotes after the fact will be good enough. I'm not surprised that you find this option to be of limited use--it *is* of limited use, it just happens to apply to my use case--but I am surprised that it is possible in pgAdmin, since I thought pgAdmin just provided a GUI wrapper to standard Postgres commands. Probably a question for the pgAdmin list as to what's happening under the hood of "Execute to file". Best, --Lee -- Lee Hachadoorian PhD, Earth& Environmental Sciences (Geography) Research Associate, CUNY Center for Urban Research http://freecity.commons.gc.cuny.edu