aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2015-09-08 04:23:32 +0930
committerMatthew Draper <matthew@trebex.net>2015-09-08 04:32:38 +0930
commit8c34d106ca66a03a78739c411a2f4ecb9fcad25d (patch)
treea7528bb2c7da508a2867714aa019aaf76e6b0893
parent64a1cb1a3e38cdf6cdcdbdc499cd020dc5f76df4 (diff)
downloadrails-8c34d106ca66a03a78739c411a2f4ecb9fcad25d.tar.gz
rails-8c34d106ca66a03a78739c411a2f4ecb9fcad25d.tar.bz2
rails-8c34d106ca66a03a78739c411a2f4ecb9fcad25d.zip
Correct query for PostgreSQL 8.2
Generic cast-to-text was only added in 8.3.
-rw-r--r--activerecord/CHANGELOG.md4
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb2
2 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index d978f13e4b..554bec17d6 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -1,3 +1,7 @@
+* Correct query for PostgreSQL 8.2 compatibility.
+
+ *Ben Murphy*, *Matthew Draper*
+
* `bin/rake db:migrate` uses
`ActiveRecord::Tasks::DatabaseTasks.migrations_paths` instead of
`Migrator.migrations_paths`.
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb b/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb
index 191c828e60..6155e53632 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb
@@ -36,7 +36,7 @@ module ActiveRecord
WHERE
t.typname IN (%s)
OR t.typtype IN (%s)
- OR t.typinput::varchar = 'array_in'
+ OR t.typinput = 'array_in(cstring,oid,integer)'::regprocedure
OR t.typelem != 0
SQL
end