Re: Deleting prepared statements from libpq.
Jelte Fennema <me@jeltef.nl>
From: Jelte Fennema <me@jeltef.nl>
To: Craig Ringer <craig@2ndquadrant.com>
Cc: Dmitry Igrishin <dmitigr@gmail.com>,
PostgreSQL Hackers <pgsql-hackers@postgresql.org>, Daniele Varrazzo <daniele.varrazzo@gmail.com>
Date: 2023-06-16T15:27:52Z
Lists: pgsql-hackers
Attachments
- v1-0001-Support-sending-Close-messages-from-libpq.patch (application/octet-stream) patch v1-0001
On Fri, 16 Jun 2023 at 16:26, Craig Ringer <craig@2ndquadrant.com> wrote: > Nobody's implemented it. > > A patch to add PQclosePrepared and PQsendClosePrepared would be welcome. At least, I think so... This might have been a pretty old thread. But I just took it upon me to implement these functions (or well I mostly copied the PQsendDescribe related code and did s/describe/close). I haven't tested this code yet but I'm pretty sure it should just work (it compiles at least). The main reason I'm interested in this is because we're actively working on implementing named prepared statement support for PgBouncer in transaction pooling mode. It works with lots of client libraries already. But sadly it doesn't work with psycopg at the moment, or at least the closing part does not. And the reason is that psycopg closes statements using a DEALLOCATE query instead of the Close protocol message, because libpq does not support sending the Close protocol message. Afaict this is not just a problem for PgBouncer its implementation. As far as I can tell the same is true for the Odyssey connection pooler (which implemented named prepared statement support first).
Commits
-
libpq: Add support for Close on portals and statements
- 28b572656184 17.0 landed
-
Fix incorrect error message in libpq_pipeline
- 451ca5c1e699 14.9 landed
- 4fd633df5080 15.4 landed
- f69a7f08fd01 16.0 landed