Re: COPY table FROM STDIN doesn't show count tag - Mailing list pgsql-hackers

From Tom Lane
Subject Re: COPY table FROM STDIN doesn't show count tag
Date
Msg-id 5007.1394733307@sss.pgh.pa.us
Whole thread Raw
In response to Re: COPY table FROM STDIN doesn't show count tag  (Rajeev rastogi <rajeev.rastogi@huawei.com>)
List pgsql-hackers
Rajeev rastogi <rajeev.rastogi@huawei.com> writes:
> [ updated patch ]

I've committed this patch with additional revisions.

> Based on my analysis, I observed that just file pointer comparison may not be sufficient 
> to decide whether to display command tag or not. E.g. imagine below scenario:

>     psql.exe -d postgres -o 'file.dat' -c " \copy tbl to 'file.dat';"

I don't think it's our responsibility to avoid printing both data and
status to the same place in such cases; arguably, in fact, that's exactly
what the user told us to do.  The important thing is to avoid printing
both for the straightforward case of COPY TO STDOUT.  For that, file
pointer comparison is the right thing, since the option-parsing code will
set copysource to match queryFout in exactly the relevant cases.

In any case, this revised patch suppressed the status print in *all*
COPY_OUT cases, which surely seems like throwing the baby out with the
bathwater.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: JSON Patch (RFC 6902) support?
Next
From: Alexander Korotkov
Date:
Subject: Re: GIN improvements part2: fast scan