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

Disable prepared_statements option? #76

Closed
danjrichards opened this issue May 19, 2020 · 3 comments
Closed

Disable prepared_statements option? #76

danjrichards opened this issue May 19, 2020 · 3 comments

Comments

@danjrichards
Copy link

Hi
I'm liking this library, so firstly thank you very much for writing it!

I'm using it to run some health check queries by starting each in a promise, then looping over my list of promises to await the result.
This generally works, but ~20% of the time I get a prepared statement "p1" already exists error thrown.
I don't see a way of disabling the use of prepared statements, but maybe I'm missing something?

Thanks
Dan

@porsager
Copy link
Owner

Hi Dan.

Thank you very much.

I've found an issue with this, that is fixed in the upcoming v2, but unfortunately I haven't had time to backport it to v1.

Would you maybe try to see if the issue persist with master here on github? (npm i porsager/postgres)

@danjrichards
Copy link
Author

It's working well with v2, thanks @porsager!

My use case right now is OK with prepared statements being used, but I know there are some circumstances where it needs to be disabled, such as when using pgbouncer in transaction pooling mode.
It would be great if that could that be added as a configuration option...?

Many thanks
Dan

@porsager
Copy link
Owner

Cool, thanks for checking!

Prepared statements should actually work well with pgbouncer in v2, but yes, even so, there should be a way to opt out.

I'll see if I can fit it in before v2 release.

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

2 participants