-
-
Notifications
You must be signed in to change notification settings - Fork 207
Description
PgBouncer does currently not parse queries at all, only protocol messages. But psycopg closes its statements using DEALOCATE sql call:
psycopg/psycopg/psycopg/_preparing.py
Line 119 in 6380363
| self._maint_commands.append(b"DEALLOCATE " + name) |
What do you think of about, instead of sending DEALLOCATE text query here, to instead send a Close protocol message? Because that would make it work automatically with the work-in-progress PgBouncer prepared statements patch: pgbouncer/pgbouncer#845
P.S. The DEALLOCATE ALL usage is similarly problematic, but maybe PgBouncer can make an exception for supporting that since it would be extremely easy to parse. And also it should not be necessary to use as I explained a few minutes ago on the PG mailing list thread that triggered this DEALLOCATE ALL usage (according to git blame): https://www.postgresql.org/message-id/flat/CAGECzQSUPTjfb7BYLg5c22tN4SSuLTRv9-6TpuZTpJ0q8hqp2w%40mail.gmail.com#b9b91ddf3d37160a3e8771e69b27f0ac