diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-11-06 08:15:34 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-11-06 13:16:07 -0300 |
commit | 9b46613780dcd0aa49abf49877baea274040c0b2 (patch) | |
tree | d323a3b36c5e08ca55dfecee7789be3282a1f718 /activerecord/lib/active_record/connection_adapters | |
parent | 6950639998968663389dcd4ade7c0e6f18996adc (diff) | |
download | rails-9b46613780dcd0aa49abf49877baea274040c0b2.tar.gz rails-9b46613780dcd0aa49abf49877baea274040c0b2.tar.bz2 rails-9b46613780dcd0aa49abf49877baea274040c0b2.zip |
Merge pull request #3521 from nulogy/fix_postgres_adapter_to_handle_spaces_between_schemas
Fix postgres adapter to handle spaces between schemas
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index 44c2fa439c..b7918c7f07 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -800,7 +800,6 @@ module ActiveRecord # Returns an array of indexes for the given table. def indexes(table_name, name = nil) - schemas = schema_search_path.split(/,/).map { |p| quote(p) }.join(',') result = query(<<-SQL, name) SELECT distinct i.relname, d.indisunique, d.indkey, pg_get_indexdef(d.indexrelid), t.oid FROM pg_class t @@ -809,7 +808,7 @@ module ActiveRecord WHERE i.relkind = 'i' AND d.indisprimary = 'f' AND t.relname = '#{table_name}' - AND i.relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname IN (#{schemas}) ) + AND i.relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname = ANY (current_schemas(false)) ) ORDER BY i.relname SQL |