Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tduh0-0007FD-7q for pgsql-sql@arkaria.postgresql.org; Thu, 29 Nov 2012 03:21:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Tdugz-0006E4-Ot for pgsql-sql@arkaria.postgresql.org; Thu, 29 Nov 2012 03:21:37 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tdugy-0006Dz-V2 for pgsql-sql@postgresql.org; Thu, 29 Nov 2012 03:21:37 +0000 Received: from mail-ie0-f174.google.com ([209.85.223.174]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tdugx-0007Bs-Cv for pgsql-sql@postgresql.org; Thu, 29 Nov 2012 03:21:36 +0000 Received: by mail-ie0-f174.google.com with SMTP id k11so11389822iea.19 for ; Wed, 28 Nov 2012 19:21:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:mail-followup-to:date:message-id:user-agent :organization:mime-version:content-type; bh=m7RlkRWhD1vPGLbWpXelpjIrovRr3yLWjfpX7ckS2l8=; b=apIUPE0gsMktjRlW+M1FLjSaqW7YcOJG0BOKejjLC0OW4Ak0/wE1L3ro04qo/sxAXt fYOaUmApgDJoZqsULeM85ve6Tp6MJFMJPSLl1eYYPFoxMTWsCI1p078TYwKpY2N1nl7W Pw5/RA0u1jQOlpLNdD03FyoM0Kg3COUIPD0s35S0YxU3DJeHx1YxMj0uiR4JC+c2AYi7 35pUsEGLkOP71y2d8QVpc1xGac902WFt4c0DvihcBLTaGtVGvcXaZU69SMPmcsB3BL3J 0onW1m5bLERE7O/MaH1Rf10xdkoX+cgyNuZXODf8jHhsWF8N1JFFOh/80yaW/RppONlH 3ZBw== Received: by 10.50.53.193 with SMTP id d1mr21656485igp.69.1354159294368; Wed, 28 Nov 2012 19:21:34 -0800 (PST) Received: from smtp.gmail.com (S0106c8d719636840.wp.shawcable.net. [24.77.164.163]) by mx.google.com with ESMTPS id uj11sm6191721igb.15.2012.11.28.19.21.33 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 28 Nov 2012 19:21:33 -0800 (PST) From: Seb To: pgsql-sql@postgresql.org Subject: \copy multiline Mail-Followup-To: pgsql-sql@postgresql.org Date: Wed, 28 Nov 2012 21:21:32 -0600 Message-ID: <87r4ndnlfn.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 Hi, 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? Cheers, -- Seb -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql