Re: When extended query protocol ends?

From: Michael Zhilin <m(dot)zhilin(at)postgrespro(dot)ru>
To: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>, Vladimir Sitnikov <sitnikov(dot)vladimir(at)gmail(dot)com>
Cc: Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>, davecramer(at)postgres(dot)rocks, tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-hackers(at)postgresql(dot)org
Subject: Re: When extended query protocol ends?
Date: 2024-02-22 12:01:36
Message-ID: 79375961-cf11-46ca-bd1d-084fff91199d@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2/22/24 14:09, Jelte Fennema-Nio wrote:
>> 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
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"
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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2024-02-22 12:15:25 Re: Porting PostgresSQL libraries for QNX710
Previous Message Amit Kapila 2024-02-22 11:53:59 Re: Synchronizing slots from primary to standby