From 9ede45f60fd112c313840e707e1fdfebb5f6b97c Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 30 Apr 2005 13:21:47 +0000 Subject: Added encoding and min_messages options for PostgreSQL #1205 [shugo] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1255 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../lib/active_record/connection_adapters/postgresql_adapter.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index f9719b9f2b..9161878d5a 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -25,6 +25,8 @@ module ActiveRecord password = config[:password].to_s schema_order = config[:schema_order] + encoding = config[:encoding] + min_messages = config[:min_messages] if config.has_key?(:database) database = config[:database] @@ -37,6 +39,8 @@ module ActiveRecord ) pga.execute("SET search_path TO #{schema_order}") if schema_order + pga.execute("SET client_encoding TO '#{encoding}'") if encoding + pga.execute("SET client_min_messages TO '#{min_messages}'") if min_messages pga end @@ -54,6 +58,8 @@ module ActiveRecord # * :password -- Defaults to nothing # * :database -- The name of the database. No default, must be provided. # * :schema_order -- An optional schema order string that is using in a SET search_path TO call on connection. + # * :encoding -- An optional client encoding that is using in a SET client_encoding TO call on connection. + # * :min_messages -- An optional client min messages that is using in a SET client_min_messages TO call on connection. class PostgreSQLAdapter < AbstractAdapter def select_all(sql, name = nil) select(sql, name) -- cgit v1.2.3