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.