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

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

Dear Tom, Fujii-san,

> > 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.

To confirm - I have no objections for the decision. I'm also think it is not
an usual grammar. I checked the doc [1] and I could not find "COPY FROM STDOUT".
I.e., first version is enough.

[1]: https://www.postgresql.org/docs/devel/sql-copy.html

Best regards,
Hayato Kuroda
FUJITSU LIMITED

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mats Kindahl 2025-01-09 07:54:56 Re: Coccinelle for PostgreSQL development [4/N]: correcting palloc() use
Previous Message Peter Smith 2025-01-09 07:46:23 Re: Question about behavior of deletes with REPLICA IDENTITY NOTHING