Skip to content

Instantly share code, notes, and snippets.

@franzejr
Last active December 26, 2021 17:25
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save franzejr/11a136389c772f8452109dd5a92dfb9c to your computer and use it in GitHub Desktop.
Save franzejr/11a136389c772f8452109dd5a92dfb9c to your computer and use it in GitHub Desktop.
Active Record 4.2.1 connection adapters - error: PG::InvalidParameterValue: ERROR: invalid value for parameter "client_min_messages": "panic" HINT: Available values: debug5, debug4, debug3, debug2, debug1, log, notice, warning, error. : SET client_min_messages TO 'panic'
# /Users/franzejr/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/activerecord-4.2.1
# Changes in activerecord (4.2.1) lib/active_record/connection_adapters/postgresql_adapter.rb
# Enable standard-conforming strings if available.
def set_standard_conforming_strings
old, self.client_min_messages = client_min_messages, 'notice'
execute('SET standard_conforming_strings = on', 'SCHEMA') rescue nil
ensure
self.client_min_messages = old
end
@nrogap
Copy link

nrogap commented May 17, 2021

Another way is to install my fixed Rails 4.2.1 gem

gem 'rails', git: 'https://github.com/nrogap/rails.git', tag: 'v4.2.1.1'

https://nrogap.medium.com/old-rails-and-postgresql-12-problem-ba44388feb1d

@jigarbhatt2711
Copy link

@nrogap Thanks a lot for your answer, you saved my life :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment