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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: Ryo Kanbayashi <kanbayashi(dot)dev(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: ecpg command does not warn COPY ... FROM STDIN;
Date: 2025-01-08 16:31:10
Message-ID: 1661748.1736353870@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> writes:
> On 2025/01/09 0:42, Tom Lane wrote:
>> 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?

Oh right. (Pokes at it...) It looks like the backend accepts
"FROM STDOUT" as a synonym for "FROM STDIN", so that's why this
is checking for both spellings. But I agree it'd be better
for the error message to only use the standard spelling.

Also I tried

regression=# copy int4_tbl from program stdin;
ERROR: STDIN/STDOUT not allowed with PROGRAM

So we probably don't need to bother with adjusting the check
to allow that.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2025-01-08 16:33:31 Re: Re: proposal: schema variables
Previous Message Peter Eisentraut 2025-01-08 16:25:07 Re: Virtual generated columns