aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorAndrew White <pixeltrix@users.noreply.github.com>2015-10-29 20:59:53 +0000
committerAndrew White <pixeltrix@users.noreply.github.com>2015-10-29 20:59:53 +0000
commita25c2cbbec86a0f17b391cbe4414445e229044d9 (patch)
tree282e63a47eebe6d1ce40e4c9c4dad9affaa3701f /activerecord/lib
parent97b3603fb643bd960da414b78eafc38af133cce0 (diff)
parent6a9323bca4a610cfb8ba3db5cf8ec1dbe762703e (diff)
downloadrails-a25c2cbbec86a0f17b391cbe4414445e229044d9.tar.gz
rails-a25c2cbbec86a0f17b391cbe4414445e229044d9.tar.bz2
rails-a25c2cbbec86a0f17b391cbe4414445e229044d9.zip
Merge pull request #22121 from gocardless/patch-2
Set standard_conforming_strings with SET
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb9
1 files changed, 2 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
index 1b8f8cab94..01746d8e14 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -281,13 +281,8 @@ module ActiveRecord
true
end
- # Enable standard-conforming strings if available.
def set_standard_conforming_strings
- execute(<<-SQL, 'SCHEMA')
- UPDATE pg_settings
- SET setting = 'on'
- WHERE name = 'standard_conforming_strings' AND context = 'user'
- SQL
+ execute('SET standard_conforming_strings = on', 'SCHEMA')
end
def supports_ddl_transactions?
@@ -652,7 +647,7 @@ module ActiveRecord
self.client_min_messages = @config[:min_messages] || 'warning'
self.schema_search_path = @config[:schema_search_path] || @config[:schema_order]
- # Use standard-conforming strings if available so we don't have to do the E'...' dance.
+ # Use standard-conforming strings so we don't have to do the E'...' dance.
set_standard_conforming_strings
# If using Active Record's time zone support configure the connection to return