Re: BUG #17235: PQsendQuery (with two sql) after PQenterPipelineMode cause ERROR

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: BUG #17235: PQsendQuery (with two sql) after PQenterPipelineMode cause ERROR
Дата
Msg-id 202110201934.4w3rlxmsbf5b@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: BUG #17235: PQsendQuery (with two sql) after PQenterPipelineMode cause ERROR  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: BUG #17235: PQsendQuery (with two sql) after PQenterPipelineMode cause ERROR  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-bugs
On 2021-Oct-20, David G. Johnston wrote:

> It seems desirable to talk about the multi-command limitation directly in
> the libpq chapter of the documentation and only refer to the protocol
> documentation for "additional reading".  We should not assume the reader of
> this material knows that extended protocol implies single command.

Sure.

> It is too late to change now but why did we feel the need to make
> PQsendQuery work in Pipeline mode at all?  

Mostly, I saw no reason not to make it work for the common case.

> Lacking a decent answer it is probably worth saying that while
> PQsendQuery works it behaves like PQsendQueryParams without any
> parameters specified.  In particular, it does not allow for multiple
> commands to be specified in the query.

Sure.

> Combine that with a mention that all interactions with the server are done
> using v3 of the extended protocol.  Maybe by rewriting the above as:
> 
> "While in pipeline mode, communication with the server is done using v3 of
> the extended query protocol.  This means that the pipeline API can be used
> to communicate with all servers that support the protocol.  It also means
> that it is not possible to include multiple commands in a single query (see
> the note in Protocol XRef for details)."

Hmm, this seems to get into too much detail for that particular spot.
Also, this paragraph is there precisely to let the reader know they can
use the pipeline mode with older server versions.  I don't disagree with
rewording the paragraph in a similar way to what you outline in the
first two phrases (not exactly that though), but the third one you
propose seems a bit out of place.  Why not add a few words to
PQsendQuery() doc blurb instead?

-- 
Álvaro Herrera           39°49'30"S 73°17'W  —  https://www.EnterpriseDB.com/



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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: BUG #17235: PQsendQuery (with two sql) after PQenterPipelineMode cause ERROR
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: BUG #17235: PQsendQuery (with two sql) after PQenterPipelineMode cause ERROR