Yes, as a consequence of how aggressively transparent to the postgres wire protocol pgbouncer wants to be. This article does a good job explaining it: https://www.augusteo.com/blog/how-pgbouncer-works
McGlockenshire 2 hours ago [-]
You'll see this kind of fun in other databases that support "persistent connections." When you start up, you have absolutely no idea what the state of the database is. If a previous process errored out, you might find yourself in the middle of a broken transaction for example. Did the last session do some weird SET magic to make things work? Did it create temporary tables? Well guess what, it's all still there!
inigyou 47 minutes ago [-]
Doesn't this NOTIFY performance fix mean that it isn't transactional any more?
levkk 35 minutes ago [-]
From the strictest CAP theorem definition, that's correct, it is not. But, it's pretty close. I know that in the database world, that's not a good answer, but in practice, it will deliver the vast majority of messages, so maybe that's good enough? We'll see.
We show that it's possible to come close without breaking the DB or the app, but I suspect, it's not quite yet at the level you'd expect from a _durable_ work queue, e.g., Kafka. Not going to replace that one anytime soon.
Well tbf pgdog looks extremely amazing on paper and goes way beyond multi threading.
The notify/listen fix and automatic query routing to read replicas and auto sharding might bringt Postgres finally closer to vitess
mmakeev 3 hours ago [-]
we moved our django app behind pgbouncer transaction pooling a few days ago and the surprise wasn't SET so much as queryset.iterator(). it relies on server side cursors, which don't survive being pooled, so we had to disable it everywhere and let it fall back to client side. also had to move statement_timeout out of the app's connection options into the pooler's own connect query, since libpq startup params just get silently ignored behind it.
Rendered at 20:13:52 GMT+0000 (Coordinated Universal Time) with Vercel.
Wow this is very bad. This actually happens in typical Postgres setups?
in pgbouncer the connection is reset via a customisable command [0] which should reset the connection to a clean state.
[0] https://www.pgbouncer.org/config.html#server_reset_query
We show that it's possible to come close without breaking the DB or the app, but I suspect, it's not quite yet at the level you'd expect from a _durable_ work queue, e.g., Kafka. Not going to replace that one anytime soon.
The notify/listen fix and automatic query routing to read replicas and auto sharding might bringt Postgres finally closer to vitess