Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seeing many prepared statement "aX" does not exist error and STATEMENT deallocate #1041

Closed
geekontheway opened this issue Mar 14, 2024 · 3 comments

Comments

@geekontheway
Copy link

geekontheway commented Mar 14, 2024

We are using the pgbouncer 1.22.1 build from git, deployed the app client side. and used in many of our Ruby on Rails Projects.

From the Postgres log, we are seeing many prepared statement "aX" does not exist error and STATEMENT deallocate. I was wondering this seems not created by pgbouncer, as pgbouncer prepared statement was named "PGBOUNCER_XXXX".

This error seems will not result to the app side exceptions, but the warnning messages were too many and a bit annoyed.

Before we use pgbouncer , the Postgres log was very clean and do not have such errors.

So can anyone help to answer my wonderings? Also it is great if you are using Ruby on Rails and wanna to share your best practices on the pgbouncer.

@Melkij
Copy link

Melkij commented Mar 14, 2024

pgbouncer processed deallocate X as a protocol command only. If your library sends deallocate as an SQL command (as indicated by STATEMENT) then this is not supported.

Most likely you need to turn off server-side prepared statements: https://www.pgbouncer.org/faq.html#how-to-use-prepared-statements-with-transaction-pooling

like #991

@JelteF
Copy link
Member

JelteF commented Mar 14, 2024

Which client are you using? It would be good to list a disclaimer in the docs that prepared statements don't work for them, just as for PDO.

@JelteF
Copy link
Member

JelteF commented May 8, 2024

Closing this as I updated the docs to say that PDO does not work with prepared statements currently.

@JelteF JelteF closed this as completed May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants