aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
index a2b32bf3e2..9169ace9f7 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -594,9 +594,11 @@ module ActiveRecord
end
def extension_enabled?(name)
- res = exec_query "SELECT EXISTS(SELECT * FROM pg_available_extensions WHERE name = '#{name}' AND installed_version IS NOT NULL)",
- 'SCHEMA'
- res.column_types['exists'].type_cast res.rows.first.first
+ if supports_extensions
+ res = exec_query "SELECT EXISTS(SELECT * FROM pg_available_extensions WHERE name = '#{name}' AND installed_version IS NOT NULL)",
+ 'SCHEMA'
+ res.column_types['exists'].type_cast res.rows.first.first
+ end
end
# Returns the configured supported identifier length supported by PostgreSQL