Re: Switching from OSX to Linux, multi-line queries in \copy don't work anymore - Mailing list pgsql-general

From Tom Lane
Subject Re: Switching from OSX to Linux, multi-line queries in \copy don't work anymore
Date
Msg-id 6985.1343408770@sss.pgh.pa.us
Whole thread Raw
In response to Switching from OSX to Linux, multi-line queries in \copy don't work anymore  (Ryan Kelly <rpkelly22@gmail.com>)
Responses Re: Switching from OSX to Linux, multi-line queries in \copy don't work anymore
List pgsql-general
Ryan Kelly <rpkelly22@gmail.com> writes:
> I recently switched from OSX to Linux and \copy in psql no longer
> accepts multi-line queries. For instance:

> \copy (
>     select
>         *
>     from
>         pg_settings
> ) to '/tmp/settings.csv' with csv header

> This works fine on OSX. On Linux I get:
> \copy: parse error at end of line

FWIW, I get that error on either OS X or Linux, and I'm a bit astonished
by your report that there are any versions of psql that allow it.
psql doesn't do multi-line backslash commands, in any context.  Are you
sure you weren't doing a plain SQL "copy" command, without a backslash?

            regards, tom lane

pgsql-general by date:

Previous
From: Ben Chobot
Date:
Subject: can we avoid pg_basebackup on planned switches?
Next
From: Tom Lane
Date:
Subject: Re: fgets failure in Solaris after patching