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

Getting Prepared Statement does not exist error while using Postgre with Pgbouncer #31

Closed
manishsaini7 opened this issue Feb 9, 2023 · 2 comments

Comments

@manishsaini7
Copy link

I am testing read and write on postgre with connection pooling and getting an error during the read query.

ERRO[0017] GoError: pq: unnamed prepared statement does not exist
running at reflect.methodValueCall (native)

I found this while searching for a solution.
https://stackoverflow.com/questions/17614441/pq-driver-prepared-statement-does-not-exist
lib/pq#389

Can you help how I can fix it?

@imiric
Copy link
Contributor

imiric commented Feb 13, 2023

Hi, thanks for reporting this issue.

I experimented with a Postgres and PgBouncer Docker Compose stack, and wasn't able to reproduce this. The postgres_test.sql example worked fine, and I was able to create prepared statements and execute them (via db.exec()), though getting the results from a SELECT is currently not supported by this extension.

Can you share a minimal script that reproduces this? And any details about your PgBouncer configuration.

Also, have you tried some of the workarounds mentioned in that SO link? Like setting binary_parameters=yes in your connection string?

And another thing: do prepared statements work fine for you without PgBouncer? We have no examples of using them with xk6-sql, as like I said above, we'd need to expose some more Go methods to JS, but I'm wondering if you only get the issue with PgBouncer.

@manishsaini7
Copy link
Author

Hi @imiric, Thanks for your response. I used the binary_parameters=yes in the connection string and it works for me.

Thanks for the support.

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