Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dhh committed Apr 30, 2005
1 parent 90b08c5 commit 9ede45f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions activerecord/CHANGELOG
@@ -1,5 +1,16 @@
*SVN*

* Added encoding and min_messages options for PostgreSQL #1205 [shugo]. Configuration example:

development:
adapter: postgresql
database: rails_development
host: localhost
username: postgres
password:
encoding: UTF8
min_messages: ERROR

* Fixed acts_as_list where deleting an item that was removed from the list would ruin the positioning of other list items #1197 [Jamis Buck]

* Added validates_exclusion_of as a negative of validates_inclusion_of
Expand Down
Expand Up @@ -25,6 +25,8 @@ def self.postgresql_connection(config) # :nodoc:
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]
Expand All @@ -37,6 +39,8 @@ def self.postgresql_connection(config) # :nodoc:
)

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
Expand All @@ -54,6 +58,8 @@ module ConnectionAdapters
# * <tt>:password</tt> -- Defaults to nothing
# * <tt>:database</tt> -- The name of the database. No default, must be provided.
# * <tt>:schema_order</tt> -- An optional schema order string that is using in a SET search_path TO <schema_order> call on connection.
# * <tt>:encoding</tt> -- An optional client encoding that is using in a SET client_encoding TO <encoding> call on connection.
# * <tt>:min_messages</tt> -- An optional client min messages that is using in a SET client_min_messages TO <min_messages> call on connection.
class PostgreSQLAdapter < AbstractAdapter
def select_all(sql, name = nil)
select(sql, name)
Expand Down

0 comments on commit 9ede45f

Please sign in to comment.