Issue
When using Rails 4.2.5 or earlier and a recent version of PostgreSQL, this error will show up in the logs:
app[web.1]: Started GET "/" for 1.2.3.4 at 2021-08-03 13:28:23 +0000
app[web.1]: PG::InvalidParameterValue: ERROR: invalid value for parameter "client_min_messages": "panic"
app[web.1]: HINT: Available values: debug5, debug4, debug3, debug2, debug1, log, notice, warning, error.
app[web.1]:
app[web.1]: ActiveRecord::StatementInvalid (PG::InvalidParameterValue: ERROR: invalid value for parameter "client_min_messages": "panic"
Resolution
Upgrade to Rails 4.2.6 or higher.
If you're using a forked version of Rails apply this patch from this original PR or ask that the maintainer of your forked Rails version to apply this patch.
Prior to this patch, Rails will not work on recent versions of Postgresql. Heroku is deprecating Postgresql 9.6.