Re: ecpg command does not warn COPY ... FROM STDIN;

Fujii Masao <masao.fujii@oss.nttdata.com>

From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Ryo Kanbayashi <kanbayashi.dev@gmail.com>, "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>, pgsql-hackers@lists.postgresql.org
Date: 2025-01-08T16:04:40Z
Lists: pgsql-hackers

On 2025/01/09 0:42, Tom Lane wrote:
> Fujii Masao <masao.fujii@oss.nttdata.com> writes:
>> On 2025/01/08 23:04, Ryo Kanbayashi wrote:
>> But it is not working.
>> ecpg command fails to notice though code like above exits on pgc code.
> 
>> This issue seems to have been introduced in commit 3d009e45bd.
> 
> Indeed :-(
> 
>> As for COPY FROM STDOUT, while it's possible, mentioning it might be
>> confusing since it's not official syntax. So I'm not sure if this is
>> good idea.
> 
> There's another problem: the correct syntax is COPY TO STDOUT,
> and that won't trigger this warning either.

ISTM that ecpg supports COPY TO STDOUT and includes the regression test "copystdout" for it. No?

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION




Commits

  1. ecpg: Restore detection of unsupported COPY FROM STDIN.

  2. plpgsql: pure parser and reentrant scanner

  3. Add support for piping COPY to/from an external program.