PG Bug reporting form wrote:
> I use libpq in C.
> I call PQsendQuery(conn, "select * from cats; select * from cats") after
> PQenterPipelineMode.
> This cause ERROR
> cannot insert multiple commands into a prepared statement.
> postgresql client 14
> postgresql server 13.4
In pipeline mode, queries are handled with the extended query protocol
which does not support multiple commands per query.
This is mentioned in this note in the documentation
(see
https://www.postgresql.org/docs/current/protocol-flow.html#PROTOCOL-FLOW-EXT-QUERY):
"The query string contained in a Parse message cannot include more than
one SQL statement; else a syntax error is reported. This restriction
does not exist in the simple-query protocol, but it does exist in the
extended protocol, because allowing prepared statements or portals to
contain multiple commands would complicate the protocol unduly."
Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: https://www.manitou-mail.org
Twitter: @DanielVerite