Re: BUG #16639: Syntax error in pgsql when executing local \copy instead of SQL copy

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: buschmann(at)nidsa(dot)net, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16639: Syntax error in pgsql when executing local \copy instead of SQL copy
Date: 2020-09-28 13:46:10
Message-ID: 20200928134610.GA9565@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Sep 28, 2020 at 01:25:08PM +0000, PG Bug reporting form wrote:
> The following bug has been logged on the website:
>
> Bug reference: 16639
> Logged by: Hans Buschmann
> Email address: buschmann(at)nidsa(dot)net
> PostgreSQL version: 13.0
> Operating system: Linux x64 or Windows 64bit
> Description:
>
> Deriving from a much longer query in our application I managed to extract a
> short query which shows the error for $subject:
>
>
> \copy (
> with

\copy is psql command, and has to be in single line.

You can see it by entering:

\copy (

and then pressing enter in psql.

Docs mention:

>> Another way to obtain the same result as \copy ... to is to use the SQL COPY
>> ... TO STDOUT command and terminate it with \g filename or \g |program. Unlike
>> \copy, this method allows the command to span multiple lines; also, variable
>> interpolation and backquote expansion can be used.

Best regards,

depesz

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2020-09-28 22:14:38 BUG #16640: Documentation table formatting issue
Previous Message PG Bug reporting form 2020-09-28 13:25:08 BUG #16639: Syntax error in pgsql when executing local \copy instead of SQL copy