Re: Replication protocol doc fix

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: Replication protocol doc fix
Дата
Msg-id 60fa27312d72485214abb9afb6000915b382e8de.camel@j-davis.com
обсуждение исходный текст
Ответ на Re: Replication protocol doc fix  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Replication protocol doc fix  (Robert Haas <robertmhaas@gmail.com>)
Re: Replication protocol doc fix  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
On Thu, 2021-06-17 at 12:42 -0400, Robert Haas wrote:
> On a casual read-through this seems pretty reasonable, but it
> essentially documents that libpq is doing the wrong thing by sending
> Sync unconditionally. As I say above, I disagree with that from a
> philosophical perspective. Then again, unless we're willing to
> redefine the wire protocol, I don't have an alternative to offer.

What if we simply mandate that a Sync must be sent before the server
will respond with CopyInResponse/CopyBothResponse, and the client must
send another Sync after CopyDone/CopyFail (or after receiving an
ErrorResponse, if the client isn't going to send a CopyDone/CopyFail)?

This will follow what libpq is already doing today, as far as I can
tell, and it will leave the server in a definite state.

In theory, it could break a client that issues Parse+Bind+Execute for a
CopyIn/CopyBoth command without a Sync, but I'm not sure there are any
clients that do that, and it's arguable whether the documentation
permitted that or not anyway.

I hacked together a quick patch; attached.

Regards,
    Jeff Davis


Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Patch for bug #17056 fast default on non-plain table
Следующее
От: Ranier Vilela
Дата:
Сообщение: Avoid call MaintainOldSnapshotTimeMapping, if old_snapshot_threshold is disabled.