[pgpool-hackers: 4286] multi-statement queries

Tatsuo Ishii ishii at sraoss.co.jp
Sat Feb 11 16:58:23 JST 2023


Hi,

Pgpool-II currently cannot fully handle multiple statement
(multi-statement) queries. For example,

BEGIN;SELECT;
SAVEPOINT foo;

will fail in streaming replication mode because "BEGIN" was sent to
the primar node, but "SAVEPOINT" will be sent to both the primary and
standbys, and standbys will complain "SAVEPOINT can only be used in
transaction blocks".

Once I tried to solve the problem by spliting the multi-statements
into multiple single statements but this resulted in a fundamental
issue: any queries in a multi-statement query have to be executed in
the same transaction.

https://www.postgresql.org/docs/current/protocol-flow.html#id-1.10.6.7.3

So pgpool should treat a multi-statement as it is. In this direction I
have come up with attached patches.

Comments and suggestions are welcome.

Best reagards,
--
Tatsuo Ishii
SRA OSS LLC
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v1-0001-Allow-to-use-multiple-statements-extensively.patch
Type: text/x-patch
Size: 19153 bytes
Desc: not available
URL: <http://www.pgpool.net/pipermail/pgpool-hackers/attachments/20230211/4d64a71e/attachment.bin>


More information about the pgpool-hackers mailing list