On Tue, Apr 28, 2026 at 5:29 AM Dmitrii Bondar <d.bondar@postgrespro.ru> wrote:
> Session mode is indeed the most transparent way to use a pooler. However, pgbench can become stuck when the number of
clientsexceeds the pool size. If the pooler cannot reserve a backend for a client, it places the client in a waiting
queue.In that case, pgbench may wait indefinitely because it is blocked in PQprepare, and the pgbench thread cannot
processresponses for other clients.
Ah, I see! This is a key point I wasn't understanding previously.
Why isn't the solution to use the existing PQsendPrepare function
instead of adding a new libpq entrypoint?
Even if we stick with the design you propose here, I don't think we
can add a function with a name like PQsendPBES, and I think we need to
find a way to more clearly explain what it does. It's kind of
unfortunate that there's such a large gap between the names of the
functions and the protocol messages that they send, but if all the
other functions are named without reference to the underlying protocol
messages, and this one is an exception, then it seems like it's going
to be hard to understand.
--
Robert Haas
EDB: http://www.enterprisedb.com