Re: When extended query protocol ends?
От | Michael Zhilin |
---|---|
Тема | Re: When extended query protocol ends? |
Дата | |
Msg-id | 79375961-cf11-46ca-bd1d-084fff91199d@postgrespro.ru обсуждение исходный текст |
Ответ на | Re: When extended query protocol ends? (Jelte Fennema-Nio <postgres@jeltef.nl>) |
Ответы |
Re: When extended query protocol ends?
|
Список | pgsql-hackers |
Hi,
On 2/22/24 14:09, Jelte Fennema-Nio wrote:
It looks like the sense of wording is "to complete transaction" at the eventual end of traffic, but not "to switch to single protocol".
Otherwise, we can't use both protocols under same transaction that looks too strict limitation.
On 2/22/24 14:09, Jelte Fennema-Nio wrote:
I would like to say this document states that "at completion... frontend should issue a Sync message... causes the backend to close the current transaction"Apparently, sending an extra message would increase the overhead of the protocol, thus reducing the efficiency of the application. What is the benefit of sending extra Sync? https://www.postgresql.org/docs/current/protocol-overview.html#PROTOCOL-MESSAGE-CONCEPTS suggests that is is fine to mix both simple and extended messages depending on the needs of the application.Yes, it's fine to mix and match extended and simple protocol. But the protocol docs quite clearly state that a sync is required before going back to the Simple protocol: "At completion of each series of extended-query messages, the frontend should issue a Sync message." https://www.postgresql.org/docs/current/protocol-flow.html#PROTOCOL-FLOW-EXT-QUERY
It looks like the sense of wording is "to complete transaction" at the eventual end of traffic, but not "to switch to single protocol".
Otherwise, we can't use both protocols under same transaction that looks too strict limitation.
Terminating a sequence of extended messages with a Query message instead of a Sync message is definitely undefined behaviour.
-- Michael Zhilin Postgres Professional +7(925)3366270 https://www.postgrespro.ru
В списке pgsql-hackers по дате отправления: