Recently in DigitalOcean has the opportunity to create Databases. This is something like a turnkey solution based on the usual Droplet with a bunch of additional database features.
One of these additional features — Connection Pools. As far as I understand this is a PgBouncer.
If I connect the database to the Rails 5.2 application in the usual way (directly), then everything is fine.
But if I use the connection through the "Connection Pools", I will get an error:
ActiveRecord::StatementInvalid: PG::DuplicatePstatement: ERROR: prepared statement "a1" already exists
This will occur when any data is received from the database.
Tell me, please, how to make it all work?
Set prepared_statements
and advisory_locks
to false
in the database configurations.
More info here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With