I fixed an issue on my rails project locally (with postgres config) while adding in database.yml this statement:
test:
prepared_statements: false
You should just be able to add ?prepared_statements=false
to the existing database url and restart your dynos. This worked for us.
heroku config:add DATABASE_URL=[old database url here]?prepared_statements=false
To check that it's set after restarting your server you can open a console and query ActiveRecord::Base.connection_config
.