Sample Header Ad - 728x90

Prepared statements with pgBouncer

2 votes
3 answers
3922 views
I have a PostgreSQL server with pgBouncer as connection pooler. My application is running on Elixir. This is my config file for pgBouncer:
* = host=X.X.X.X  port=5432
logfile = /var/log/postgresql/pgbouncer.log
pidfile = /var/run/postgresql/pgbouncer.pid
listen_addr = 0.0.0.0
listen_port = 6432
unix_socket_dir = /var/run/postgresql
auth_type = trust
auth_file = /etc/pgbouncer/userlist.txt
admin_users = admin
pool_mode = transaction
ignore_startup_parameters = extra_float_digits
server_check_query = select 1
server_check_delay = 30
max_client_conn = 10000
default_pool_size = 5
min_pool_size = 3
reserve_pool_size = 3
server_reset_query = DEALLOCATE ALL;
When I use the *transaction* pooling I'm getting this error:
ERROR 08P01 (protocol_violation) bind message supplies 4 parameters, but prepared statement "ecto_323" requires 2
Then I changed it to *session* pooling mode. This time I'm getting this error:
ERROR 26000 (invalid_sql_statement_name) prepared statement "ecto_83" does not exist
How do I fix this from pgBouncer? When I connect the DB directly, I didn't see any errors. It was running more than a year without any proxy. We are implementing pgBouncer now.
Asked by TheDataGuy (1986 rep)
Aug 25, 2020, 11:18 AM
Last activity: Nov 3, 2023, 09:42 AM