Re: exactly what is COPY BOTH mode supposed to do in case of an error?

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: exactly what is COPY BOTH mode supposed to do in case of an error?
Дата
Msg-id CA+U5nM+OcC_AV5-_1D9AWXju9KAfMJ9VYApMrcJwzEbFF6nNPA@mail.gmail.com
обсуждение исходный текст
Ответ на exactly what is COPY BOTH mode supposed to do in case of an error?  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: exactly what is COPY BOTH mode supposed to do in case of an error?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: exactly what is COPY BOTH mode supposed to do in case of an error?  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On 27 April 2013 03:22, Robert Haas <robertmhaas@gmail.com> wrote:

> It seems the backend and libpq don't agree.  The backend makes no
> special provision to wait for a CopyDone message if an error occurs
> during copy-both.  It simply sends an ErrorResponse and that's it.
> libpq, on the other hand, treats either CopyDone or ErrorResponse as a
> cue to transition to PGASYNC_COPY_IN (see pqGetCopyData3).

Well spotted, and good detective work.

> I'm attaching a patch which adopts the position that the backend is
> right and libpq is wrong.  The opposite approach is also possible, but
> I haven't tried to implement it.  Or maybe there's a third way which
> is better still.

I guess if we assume this only affects replication we could change it
at either end, not sure about that.

libpq updates are much harder to roll out, so it would be better to
assume that it is correct and the backend is wrong if we want to
backpatch the fix.

Not sure if that is a lot of work?

--Simon Riggs                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Assert's vs elog ERROR vs elog FATAL
Следующее
От: Tom Lane
Дата:
Сообщение: Remaining beta blockers