Open Vonng opened 1 week ago
I couldn't find a way to override the jackc/pgx
driver's Ping
behavior with pgbouncer.
So I revert PR 52 temporarily until there's a proper solution.
Besides, using lib/pq
will reduce binary size by 5MB (20MB vs 15MB), which may be another advantage. 😊
Sorry about that! Yes, thanks for reverting. I can look into it later and see. I can work around the issues I have with lib/pq
for now or carry a local patch.
Logging an error for a query like -- ping
query is a bug in pgbouncer IMO. PostgreSQL itself accepts empty query strings, and many clients use these for a keepalive / liveness check.
What pgbouncer version are you using though? It should support the extended query protocol fine, and in fact supports disabling the simple query protocol.
Some related discussion:
I'd like to get it onto an updated driver at some point.
Quite surprised by the image size change, but the real world resource use at runtime is probably what matters.
At some point I hope to get time to write some test cases and a harness setup with Ginkgo or something, so this sort of thing can be checked for more effectively.
Two problems with the new
jackc/pgx
drvier when working with pgBouncer:Pgbouncer works with
SimpleQueryProtocol
, which can be solved by:The driver will send
-- ping
command to pgbouncer, which will trigger an error log periodicallyThe latter one seems tricky; I'm looking into it.
;-) Any thoughts on this ? @ringerc