Re: [HACKERS] COPY FROM STDIN behaviour on end-of-file - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: [HACKERS] COPY FROM STDIN behaviour on end-of-file
Date
Msg-id CAEepm=05PwS=Ad00DXLTt_cS-T+CdeLksmB9NihZXhGLkX5g3w@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] COPY FROM STDIN behaviour on end-of-file  (Vaishnavi Prabakaran <vaishnaviprabakaran@gmail.com>)
Responses Re: [HACKERS] COPY FROM STDIN behaviour on end-of-file  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Tue, May 16, 2017 at 6:29 PM, Vaishnavi Prabakaran
<vaishnaviprabakaran@gmail.com> wrote:
> On Tue, May 16, 2017 at 8:40 AM, Thomas Munro
> <thomas.munro@enterprisedb.com> wrote:
>>
>>
>> I you hit ^d while COPY FROM STDIN is reading then subsequent COPY
>> FROM STDIN commands return immediately.
>
>
> Hi, I could not reproduce this issue. Even after Ctrl+d , subsequent COPY
> from commands reads the input properly. Is there any specific step you
> followed or can you share the sample testcase?

Hmm.  Doesn't happen on GNU/Linux, does happen on macOS and FreeBSD.  Example:

postgres=# create table t(a int);
CREATE TABLE
postgres=# copy t(a) from stdin;
Enter data to be copied followed by a newline.
End with a backslash and a period on a line by itself.
>> 42
>> [...press ^d here ...]COPY 1
postgres=# copy t(a) from stdin;
Enter data to be copied followed by a newline.
End with a backslash and a period on a line by itself.
>> COPY 0

-- 
Thomas Munro
http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: amul sul
Date:
Subject: Re: [HACKERS] [POC] hash partitioning
Next
From: tushar
Date:
Subject: [HACKERS] synchronous_commit option is not visible after pressing TAB