Support Prepared statement when using pooler

I am using Neon db in Rust using SQLX and getting prepared statement errors “error returned from the database: the prepared statement “sqlx_s_26” already exists” due to the limitation mentioned in connection pooling docs " Neon uses PgBouncer in transaction mode, which does not support Postgres features such as prepared statements or [LISTEN].”

My application is deployed on AWS lambda and if lambda scales out it starts to get connection limit errors. Is there any way or plan in the future to support prepared pooling?

There is also this PR about to merge https://github.com/pgbouncer/pgbouncer/pull/845 which will support prepared statements on PgBouncer, do you think when it is connected you guys will be able to update or provide the option to turn on ready pooling method?

This is the only reason I cannot utilize the full potential of powerful neon db in lambda serverless.

I appreciate the work you guys are doing to make the developer experience smooth. Thanks for that.

4 Likes

The PR has been merged.

I’m getting heaps of those:

⨯ NeonDbError: db error: ERROR: prepared statement "s2338" already exists

esp. with 5+ concurrent sql queries running.

Can we get some :eyes: on this issue please?

There were issues between new pgbouncer mode and popular clients: Prisma PgBouncer mode doesn't play nice with PGBouncer v1.21.0 · Issue #21635 · prisma/prisma · GitHub `DEALLOCATE ALL` not being handled with new support for named prepared statements leads to problems · Issue #974 · pgbouncer/pgbouncer · GitHub. It was recently fixed. We are going to give it few more rounds of testing and then release

Hi, is there an ETA when it will be released? this is affecting us.