Re: Replication protocol doc fix

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: Replication protocol doc fix
Дата
Msg-id 6fd5e90a90e25e8b420d183152b708ab23510201.camel@j-davis.com
обсуждение исходный текст
Ответ на Re: Replication protocol doc fix  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Replication protocol doc fix  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Replication protocol doc fix  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Mon, 2021-06-14 at 10:51 -0400, Robert Haas wrote:
> but if
> > > you use the extended query protocol, then the result is a
> > > hopeless
> > > mess, because the protocol is badly designed:
> > > 

After looking in more detail, I think I understand a bit better.
Clients don't differentiate between:

* A normal command, where you know that you've sent everything that you
will send. In this case, the client needs to send the Sync message in
order to get the ReadyForQuery message.

* A command that initiates CopyIn/CopyBoth, where you are going to send
more data after the command. In this case, sending the Sync eagerly is
wrong, and you can't pipeline more queries in the middle of
CopyIn/CopyBoth mode. Instead, the client should send Sync after
receiving an ErrorResponse, or after sending a CopyDone/CopyFail
(right?).

One thing I don't fully understand is what would happen if the client
issued the Sync as the *first* message in an extended-protocol series.

> > > But I think you're correct in saying that the discard-until-Sync
> > > behavior only happens if the extended query protocol is used, so
> > > I
> > > agree that the current text is wrong.
> > 
> > Should we just document how CopyBoth works with the simple query
> > protocol, or should we make it match the CopyIn docs?
> 
> I think it would make sense to make it match the CopyIn docs.
> Possibly
> the CopyOut docs should be made more similar as well.

I attached a doc patch that hopefully clarifies this point as well as
the weirdness around CopyIn/CopyBoth and the extended protocol. I
reorganized the sections, as well.

Regards,
    Jeff Davis



Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Python 3.10 breaks regression tests with traceback changes
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Replication protocol doc fix