Re: COPY table FROM STDIN doesn't show count tag

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: COPY table FROM STDIN doesn't show count tag
Дата
Msg-id 5007.1394733307@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: COPY table FROM STDIN doesn't show count tag  (Rajeev rastogi <rajeev.rastogi@huawei.com>)
Список 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 по дате отправления:

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: JSON Patch (RFC 6902) support?
Следующее
От: Alexander Korotkov
Дата:
Сообщение: Re: GIN improvements part2: fast scan