-
Notifications
You must be signed in to change notification settings - Fork 855
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
4.1.2 Can't query with with PGBouncer? #650
Comments
There are a few restrictions when using PgBouncer. One is that you cannot use prepared statements. So if you have any explicit prepared statement usage that would be a problem. But also pgx automatically uses prepared statements internally. So that needs to be disabled for pgx to work with pgbouncer. There are two ways of doing that:
|
I tried to use |
@glebwell I don't recognize the error |
@jackc, thanks for quick reply. I figured out that the error |
It is safe -- as in nothing should break -- but the functionality is mutually exclusive. The statement cache is only used with the extended protocol. So when |
@jackc, thanks for good explanation. |
@jackc We are use PgBouncer with session mode and use binary_parameters=yes connection option, because we need to send parameters with prepared statement. But on connect, we received |
Is With pgx and PgBouncer you will want to use either |
@jackc Could you please explain what kind of issues we might encounter during schema changes on live application with describe mode? |
Describe statement cache mode allows pgx to remember the argument types and result types from a query. If a column type changes then query errors or even data corruption could occur. For example, if the server changed a column from an |
Thank you guys for this thread, it helps a lot. I have one more question about v4. @jackc, why |
No reason. Just never implemented. It's on master now. |
@jackc thank you very much! |
For everyone, who used this but migrated to V5. Right now, simple protocol can be enabled in a different way.
|
Error for search engines.
|
@pavelpatrin thanks for that |
wasn't super clear to me but this effectively means changing the connection string from
into
Or adding to the query itself
|
Connecting to PGBouncer, without SSL, and attempting to run any query fails with:
I also tried 4.0.0 and it seems that this error is not new. Looks quite similar to #512. I attempted both the
sql.DB
interface and the nativepgx
interface to no avail.Versions:
The text was updated successfully, but these errors were encountered: