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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ryan Kelly <rpkelly22(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Switching from OSX to Linux, multi-line queries in \copy don't work anymore
Date: 2012-07-27 17:06:10
Message-ID: 6985.1343408770@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ryan Kelly <rpkelly22(at)gmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2012-07-27 17:21:10 Re: fgets failure in Solaris after patching
Previous Message Ben Chobot 2012-07-27 17:00:41 can we avoid pg_basebackup on planned switches?