diff options
author | Andrew White <pixeltrix@users.noreply.github.com> | 2015-10-29 16:44:18 +0000 |
---|---|---|
committer | Andrew White <pixeltrix@users.noreply.github.com> | 2015-10-29 16:44:18 +0000 |
commit | 3ad796eccc16f45ec65d0b4ba06d569fc3a92b30 (patch) | |
tree | 9ade065dbe50103f907b3bca734484e70e7e0e78 /activerecord/lib | |
parent | 5243946017d09afff4d70d273b0fcdfd41a4b22a (diff) | |
parent | d05bfa82ae1bb6dfb6dd4c4a7e089eff456cf4af (diff) | |
download | rails-3ad796eccc16f45ec65d0b4ba06d569fc3a92b30.tar.gz rails-3ad796eccc16f45ec65d0b4ba06d569fc3a92b30.tar.bz2 rails-3ad796eccc16f45ec65d0b4ba06d569fc3a92b30.zip |
Merge pull request #22101 from gocardless/ar-pgbouncer-fix
Avoid disabling postgres errors
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index 236c067fd5..1b8f8cab94 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -283,10 +283,11 @@ module ActiveRecord # Enable standard-conforming strings if available. def set_standard_conforming_strings - old, self.client_min_messages = client_min_messages, 'panic' - execute('SET standard_conforming_strings = on', 'SCHEMA') rescue nil - ensure - self.client_min_messages = old + execute(<<-SQL, 'SCHEMA') + UPDATE pg_settings + SET setting = 'on' + WHERE name = 'standard_conforming_strings' AND context = 'user' + SQL end def supports_ddl_transactions? |