Live data from Hacker News

Why we built yet another Postgres connection pooler

pgdog.dev

31–40 of 74 posts

Re: Why we built yet another Postgres connection pooler

#31
post #22

Earlier quoted context omitted.

> 4. Use separate bouncers for each application that might be different (extension of #1) I wonder if clients send something equivalent to a User-Agent, such that the connection pooler could assign them to different pools automatically.

This exists, its called a user. You just use different database users for this.

I was thinking of something that only exists at the pool level.

Every new version of your app has the potential to change behavior in a way that would affect the previous version if the connection was recycled during a progressive rollout.

But I don’t think I would want to create a real database user for every version of the app.

I suppose the connection pooler could map versioned users to the same real user, and use separate pools, but a dedicated UA field is probably better.

Re: Why we built yet another Postgres connection pooler

#32
post #23
post #13

Earlier quoted context omitted.

>might bringt Postgres finally closer to vitess Supabase are launching a Vitess for Postgresql, they have hired the original creator of Vitess for it https://supabase.com/blog/multigres-vitess-for-postgres

And Planetscale (who is the current primary maintainer of vitess) is developing a Vitess for PostgreSQL. There will be a couple of production-grade PG vitess solutions the next months.

Looked it up, says 'Will be released as an open source project' but announcement was in July 2025 and no public repo yet which is strange, so time will tell if they will stick to this.

https://planetscale.com/blog/planetscale-for-postgres#vitess...

https://planetscale.com/neki

...

Supabase one is open from start:

https://github.com/multigres/multigres

https://multigres.com/

Re: Why we built yet another Postgres connection pooler

#33
post #32
post #23

Earlier quoted context omitted.

And Planetscale (who is the current primary maintainer of vitess) is developing a Vitess for PostgreSQL. There will be a couple of production-grade PG vitess solutions the next months.

Looked it up, says 'Will be released as an open source project' but announcement was in July 2025 and no public repo yet which is strange, so time will tell if they will stick to this. https://planetscale.com/blog/planetscale-for-postgres#vitess... https://planetscale.com/neki ... Supabase one is open from start: https://github.com/multigres/multigres https://multigres.com/

We are already moving Neki customers into production. Nobody else is even close. PlanetScale doesn't spend our days yapping about what we are going to do. We just do it.

Re: Why we built yet another Postgres connection pooler

#34
post #32

Earlier quoted context omitted.

Looked it up, says 'Will be released as an open source project' but announcement was in July 2025 and no public repo yet which is strange, so time will tell if they will stick to this. https://planetscale.com/blog/planetscale-for-postgres#vitess... https://planetscale.com/neki ... Supabase one is open from start: https://github.com/multigres/multigres https://multigres.com/

We are already moving Neki customers into production. Nobody else is even close. PlanetScale doesn't spend our days yapping about what we are going to do. We just do it.

Congrats!

The question was whether your previous statement about it being open source was still the case, or is it now going to be propriety?

Re: Why we built yet another Postgres connection pooler

#35
post #22

Earlier quoted context omitted.

This exists, its called a user. You just use different database users for this.

I was thinking of something that only exists at the pool level. Every new version of your app has the potential to change behavior in a way that would affect the previous version if the connection was recycled during a progressive rollout. But I don’t think I would want to create a real database user for every version of the app. I suppose the connection pooler could map versioned users to the same real user, and use…

> But I don’t think I would want to create a real database user for every version of the app.

Why not? Database users are (usually) not expensive, and with groups you can give access to a group you just add the user to.

Adding this logic to the connection pooler seems more complicated.

Re: Why we built yet another Postgres connection pooler

#36
post #34

Earlier quoted context omitted.

We are already moving Neki customers into production. Nobody else is even close. PlanetScale doesn't spend our days yapping about what we are going to do. We just do it.

Congrats! The question was whether your previous statement about it being open source was still the case, or is it now going to be propriety?

More details on this are coming soon.

Re: Why we built yet another Postgres connection pooler

#37
post #34

Earlier quoted context omitted.

Congrats! The question was whether your previous statement about it being open source was still the case, or is it now going to be propriety?

More details on this are coming soon.

Thanks.

Appreciate your company has spent a lot of money on the project.

Re: Why we built yet another Postgres connection pooler

#38

Earlier quoted context omitted.

I was thinking of something that only exists at the pool level. Every new version of your app has the potential to change behavior in a way that would affect the previous version if the connection was recycled during a progressive rollout. But I don’t think I would want to create a real database user for every version of the app. I suppose the connection pooler could map versioned users to the same real user, and use…

> But I don’t think I would want to create a real database user for every version of the app. Why not? Database users are (usually) not expensive, and with groups you can give access to a group you just add the user to. Adding this logic to the connection pooler seems more complicated.

Because it means connecting to the database to provision a new user on every deploy.

Also because it doesn’t really concern the database, it concerns the pooler.

Connection poolers already maintain multiple pools, it would not be complicated at all.

Re: Why we built yet another Postgres connection pooler

#39
The fact that PgDog supports prepared statements[0] is a compelling feature in and of itself. This was a limitation of older versions of pgpool-II[1] thus disqualifying it in efforts where it otherwise could have been beneficial.

0 - https://docs.pgdog.dev/features/connection-pooler/prepared-s...

1 - https://www.pgpool.net/docs/4.7/en/html/

Re: Why we built yet another Postgres connection pooler

#40
post #2

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…

Using server-side cursors is a sign of bad design. You use the PostgreSQL server's resources as a cache when you're fetching and processing stuff row by row, which is very bad. Just get the data you requested in the first place in one go and do your stuff in your app. Or process all data on the server and then get the processed data in one batch as well.

As said above, SQL is a set based language and one shouldn’t write a cursor to deal with individual rows unless no other way.

And if writing a server side cursor, probably better to write a stored procedure /function and put the cursor and its logic in it, and then call that rather than handle in application

Post reply on HN