diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-05-15 10:14:04 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-05-15 10:14:04 -0700 |
commit | f22dbc62bdf73afdffb7461b9c84c7dd4936b42c (patch) | |
tree | e8c1ae95eec63478a6c2550be678083a1b82d2af /activerecord/lib/active_record/connection_adapters | |
parent | ed738f75d2939a29fd901eba6d4fb0fb36f4e375 (diff) | |
parent | 91c4d0b1e713ee21a9078ce714faa4037df7ad57 (diff) | |
download | rails-f22dbc62bdf73afdffb7461b9c84c7dd4936b42c.tar.gz rails-f22dbc62bdf73afdffb7461b9c84c7dd4936b42c.tar.bz2 rails-f22dbc62bdf73afdffb7461b9c84c7dd4936b42c.zip |
Merge pull request #10504 from kennyj/support_pg_91
Also should supports PostgreSQL 9.1 about extensions.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 8 |
1 files changed, 4 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 88b09e7999..d5a603cadc 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -622,9 +622,9 @@ module ActiveRecord true end - # Returns true if pg > 9.2 + # Returns true if pg > 9.1 def supports_extensions? - postgresql_version >= 90200 + postgresql_version >= 90100 end # Range datatypes weren't introduced until PostgreSQL 9.2 @@ -646,9 +646,9 @@ module ActiveRecord def extension_enabled?(name) if supports_extensions? - res = exec_query "SELECT EXISTS(SELECT * FROM pg_available_extensions WHERE name = '#{name}' AND installed_version IS NOT NULL)", + res = exec_query "SELECT EXISTS(SELECT * FROM pg_available_extensions WHERE name = '#{name}' AND installed_version IS NOT NULL) as enabled", 'SCHEMA' - res.column_types['exists'].type_cast res.rows.first.first + res.column_types['enabled'].type_cast res.rows.first.first end end |