Skip to content

Instantly share code, notes, and snippets.

@franzejr
Last active December 26, 2021 17:25
Show Gist options
  • 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
@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