RE: ecpg command does not warn COPY ... FROM STDIN;
Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
From: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
To: 'Tom Lane' <tgl@sss.pgh.pa.us>, Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: Ryo Kanbayashi <kanbayashi.dev@gmail.com>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2025-01-09T07:52:57Z
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
Commits
-
ecpg: Restore detection of unsupported COPY FROM STDIN.
- 226c9048d734 13.19 landed
- d06ab3c0c117 14.16 landed
- 71ef47cf0f20 15.11 landed
- 5c7c34db2511 16.7 landed
- ba2dbedd5396 17.3 landed
- 94b914f601bd 18.0 landed
-
plpgsql: pure parser and reentrant scanner
- 7b27f5fd36cb 18.0 cited
-
Add support for piping COPY to/from an external program.
- 3d009e45bde2 9.3.0 cited