Re: BUG #15535: psql: \copy: parse error at... - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: BUG #15535: psql: \copy: parse error at...
Date
Msg-id CAKFQuwZpKkN3E_FC+Z=J11ncdVBzCWVX24c4KPhrMt+xz1Ed+w@mail.gmail.com
Whole thread Raw
In response to RE: BUG #15535: psql: \copy: parse error at...  ("Voillequin, Jean-Marc" <Jean-Marc.Voillequin@moodys.com>)
Responses Re: BUG #15535: psql: \copy: parse error at...  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On Wednesday, December 5, 2018, Voillequin, Jean-Marc <Jean-Marc.Voillequin@moodys.com> wrote:

SIMPLE=> \copy (select * from /*comment*/ pg_tables) to 'test';

COPY 76

 

SIMPLE=> \copy (select * from /*comment with a closing parenthesis)*/ pg_tables) to 'test';

\copy: parse error at "*/"

 

Only comments without parenthesis are supported?


More or less...the stuff between the parentheses is a query to be sent to the server for execution and that is basically just plain text as far as psql is concerned.  That it contains comments for the server to interpret is just passing through of unevaluated text.  psql \copy doesn't understand comments.

David J.

pgsql-bugs by date:

Previous
From: "Voillequin, Jean-Marc"
Date:
Subject: RE: BUG #15535: psql: \copy: parse error at...
Next
From: Alvaro Herrera
Date:
Subject: Re: BUG #15536: ERROR: column "value " does not exist