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

From: Ryo Kanbayashi <kanbayashi(dot)dev(at)gmail(dot)com>
To: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(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 11:34:54
Message-ID: CANOn0Ex9oN_ZFm9v8Sf4X6PSMkh7buoo2713wkLgGHKUXMLcpg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dear Tom, Fujii-san, Kuroda-san,

I saw comments of yours and recognized that better fix is below.

- Fix of first attached patch which does not change warning message

And I created patch entry of commitfest :)
https://commitfest.postgresql.org/52/5497/

What should I do additionally?
Do I need to write patches for current supporting versions? (12.x - 17.x)

--
Best regards,
Ryo Kanbayashi
https://github.com/ryogrid

On Thu, Jan 9, 2025 at 4:53 PM Hayato Kuroda (Fujitsu)
<kuroda(dot)hayato(at)fujitsu(dot)com> wrote:
>
> 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
>

Attachment Content-Type Size
copy_from_stdin_no_warning.patch application/octet-stream 851 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robins Tharakan 2025-01-09 11:47:06 Re: Several buildfarm animals fail tests because of shared memory error
Previous Message Ashutosh Bapat 2025-01-09 11:29:22 Re: POC: enable logical decoding when wal_level = 'replica' without a server restart