Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Te657-0000wl-MQ for pgsql-sql@arkaria.postgresql.org; Thu, 29 Nov 2012 15:31:17 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Te657-0004Ku-5s for pgsql-sql@arkaria.postgresql.org; Thu, 29 Nov 2012 15:31:17 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Te655-0004Jp-NY for pgsql-sql@postgresql.org; Thu, 29 Nov 2012 15:31:15 +0000 Received: from mail-ia0-f174.google.com ([209.85.210.174]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Te654-00018O-GA for pgsql-sql@postgresql.org; Thu, 29 Nov 2012 15:31:15 +0000 Received: by mail-ia0-f174.google.com with SMTP id y25so10948224iay.19 for ; Thu, 29 Nov 2012 07:31:13 -0800 (PST) Received: by 10.50.161.130 with SMTP id xs2mr23047473igb.34.1354203073286; Thu, 29 Nov 2012 07:31:13 -0800 (PST) Received: from smtp.gmail.com (S0106c8d719636840.wp.shawcable.net. [24.77.164.163]) by mx.google.com with ESMTPS id gs6sm1751098igc.11.2012.11.29.07.31.11 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 29 Nov 2012 07:31:12 -0800 (PST) From: Sebastian P. Luque To: Ben Morrow Cc: pgsql-sql@postgresql.org Subject: Re: \copy multiline References: <20121129080127.GA54729@anubis.morrow.me.uk> Mail-Followup-To: Ben Morrow , pgsql-sql@postgresql.org Date: Thu, 29 Nov 2012 09:31:10 -0600 In-Reply-To: <20121129080127.GA54729@anubis.morrow.me.uk> (Ben Morrow's message of "Thu, 29 Nov 2012 08:01:31 +0000") Message-ID: <87boego281.fsf@kolob.subpolar.dyndns.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Organization: University of Manitoba MIME-Version: 1.0 Content-Type: text/plain X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org On Thu, 29 Nov 2012 08:01:31 +0000, Ben Morrow wrote: > Quoth spluque@gmail.com (Seb): >> I use \copy to output tables into CSV files: >> \copy (SELECT ...) TO 'a.csv' CSV >> but for long and complex SELECT statements, it is cumbersome and >> confusing to write everything in a single line, and multiline >> statements don't seem to be accepted. Is there an alternative, or am >> I missing an continuation-character/option/variable that would allow >> multiline statements in this case? > CREATE TEMPORARY VIEW? Of course, that's perfect. Thanks! -- Seb -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql