\copy multiline

From: Seb <spluque(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: \copy multiline
Date: 2012-11-29 03:21:32
Message-ID: 87r4ndnlfn.fsf@kolob.subpolar.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Guillaume Lelarge 2012-11-29 09:33:37 Re: \copy multiline
Previous Message David Johnston 2012-11-28 18:52:27 Re: Joining several rows into only one