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

CONNECTION_CLOSED with PgBouncer #93

Closed
deman4ik opened this issue Jul 9, 2020 · 4 comments
Closed

CONNECTION_CLOSED with PgBouncer #93

deman4ik opened this issue Jul 9, 2020 · 4 comments

Comments

@deman4ik
Copy link

deman4ik commented Jul 9, 2020

Sometimes I have CONNECTION_CLOSED errors while using PgBouncer in transaction mode.

Any suggestions how I can may be tweak some connection parameters to prevent those kind of errors?

Direct connection to Pg seems working fine.

@porsager
Copy link
Owner

porsager commented Jul 9, 2020 via email

@deman4ik
Copy link
Author

deman4ik commented Jul 9, 2020

@porsager It turns out I’m already using it on dev environment. So this problem occurs in beta version.

@porsager
Copy link
Owner

porsager commented Jul 9, 2020

Ahha.. It seems that if you run in transaction mode Protocol-level prepared plans which Postgres.js does automatically for you, is not allowed with PgBouncer. It says in the footnote that

It is possible to add support for that into PgBouncer.

But it doesn't lead to anywhere, so maybe it's something they're looking at for the future?

I would say this is another good reason to add an option to disable the automatic prepared statements in Postgres.js, which was also mentioned in another issue.

Edit: I found pgbouncer/pgbouncer#242 and pgbouncer/pgbouncer#467 which talks about supporting it in PgBouncer.

@mrl5
Copy link

mrl5 commented May 24, 2024

worth noting that since PgBouncer >=1.21.0 protocol-level named prepared statements are supported. Additional ref: https://www.pgbouncer.org/config.html#max_prepared_statements

max_prepared_statements

When this is set to a non-zero value PgBouncer tracks protocol-level named prepared statements related commands sent by the client in transaction and statement pooling mode

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