Re: COPY FROM STDIN behaviour on end-of-file

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Vaishnavi Prabakaran <vaishnaviprabakaran(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: COPY FROM STDIN behaviour on end-of-file
Date: 2017-05-16 11:10:34
Message-ID: CAEepm=05PwS=Ad00DXLTt_cS-T+CdeLksmB9NihZXhGLkX5g3w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 16, 2017 at 6:29 PM, Vaishnavi Prabakaran
<vaishnaviprabakaran(at)gmail(dot)com> wrote:
> On Tue, May 16, 2017 at 8:40 AM, Thomas Munro
> <thomas(dot)munro(at)enterprisedb(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message tushar 2017-05-16 11:18:10 synchronous_commit option is not visible after pressing TAB
Previous Message amul sul 2017-05-16 10:52:07 Re: [POC] hash partitioning