diff options
| author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2022-09-23 18:21:22 +0200 |
|---|---|---|
| committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2022-09-23 18:21:22 +0200 |
| commit | 0032a5456708811ca95bd80a538f4fb72ad0dd20 (patch) | |
| tree | 0f9578f369e26b1dea267ff9e1c94525bbef325e /doc/src | |
| parent | d11a41a4ce79660d1a1c5f81b051061717099a9f (diff) | |
Remove PQsendQuery support in pipeline mode
The extended query protocol implementation I added in commit
acb7e4eb6b1c has bugs when used in pipeline mode. Rather than spend
more time trying to fix it, remove that code and make the function rely
on simple query protocol only, meaning it can no longer be used in
pipeline mode.
Users can easily change their applications to use PQsendQueryParams
instead. We leave PQsendQuery in place for Postgres 14, just in case
somebody is using it and has not hit the mentioned bugs; but we should
recommend that it not be used.
Backpatch to 15.
Per bug report from Gabriele Varrazzo.
Discussion: https://postgr.es/m/CA+mi_8ZGSQNmW6-mk_iSR4JZB_LJ4ww3suOF+1vGNs3MrLsv4g@mail.gmail.com
Diffstat (limited to 'doc/src')
| -rw-r--r-- | doc/src/sgml/libpq.sgml | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index 8a1a9e9932c..57bfc8fc714 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -4601,8 +4601,7 @@ int PQsendQuery(PGconn *conn, const char *command); </para> <para> - In pipeline mode, command strings containing more than one SQL command - are disallowed. + In pipeline mode, this function is disallowed. </para> </listitem> </varlistentry> @@ -5056,6 +5055,7 @@ int PQflush(PGconn *conn); <xref linkend="libpq-PQpipelineStatus"/> can be used to test whether pipeline mode is active. In pipeline mode, only <link linkend="libpq-async">asynchronous operations</link> + that utilize the extended query protocol are permitted, command strings containing multiple SQL commands are disallowed, and so is <literal>COPY</literal>. Using synchronous command execution functions @@ -5067,6 +5067,8 @@ int PQflush(PGconn *conn); <function>PQdescribePrepared</function>, <function>PQdescribePortal</function>, is an error condition. + <function>PQsendQuery</function> is + also disallowed, because it uses the simple query protocol. Once all dispatched commands have had their results processed, and the end pipeline result has been consumed, the application may return to non-pipelined mode with <xref linkend="libpq-PQexitPipelineMode"/>. @@ -5095,8 +5097,7 @@ int PQflush(PGconn *conn); <para> After entering pipeline mode, the application dispatches requests using - <xref linkend="libpq-PQsendQuery"/>, - <xref linkend="libpq-PQsendQueryParams"/>, + <xref linkend="libpq-PQsendQueryParams"/> or its prepared-query sibling <xref linkend="libpq-PQsendQueryPrepared"/>. These requests are queued on the client-side until flushed to the server; |
