diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2006-08-19 05:46:21 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2006-08-19 05:46:21 +0000 |
commit | b0a86f8c0ed24a53437bcd143069a1ea4cea4fab (patch) | |
tree | ba0095ce75e460d020e294afc3d52e5e388715e8 /activerecord/lib | |
parent | b006317b442c3eac2c41e975372d460942c48ba2 (diff) | |
download | rails-b0a86f8c0ed24a53437bcd143069a1ea4cea4fab.tar.gz rails-b0a86f8c0ed24a53437bcd143069a1ea4cea4fab.tar.bz2 rails-b0a86f8c0ed24a53437bcd143069a1ea4cea4fab.zip |
PostgreSQL: simplify index introspection query. Closes #5819.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4788 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index d2a65fec3f..12ac01339f 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -1,3 +1,4 @@ + require 'active_record/connection_adapters/abstract_adapter' module ActiveRecord @@ -209,11 +210,7 @@ module ActiveRecord AND t.oid = d.indrelid AND t.relname = '#{table_name}' AND a.attrelid = t.oid - AND ( d.indkey[0]=a.attnum OR d.indkey[1]=a.attnum - OR d.indkey[2]=a.attnum OR d.indkey[3]=a.attnum - OR d.indkey[4]=a.attnum OR d.indkey[5]=a.attnum - OR d.indkey[6]=a.attnum OR d.indkey[7]=a.attnum - OR d.indkey[8]=a.attnum OR d.indkey[9]=a.attnum ) + AND a.attnum = ANY (d.indkey) ORDER BY i.relname SQL |