Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 4788

Show
Ignore:
Timestamp:
08/19/06 05:46:21 (2 years ago)
Author:
bitsweat
Message:

PostgreSQL: simplify index introspection query. Closes #5819.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activerecord/CHANGELOG

    r4786 r4788  
    11*SVN* 
     2 
     3* PostgreSQL: simplify index introspection query.  #5819 [stephen_purcell@yahoo.com] 
    24 
    35* Add records to has_many :through using <<, push, and concat by creating the association record. Raise if base or associate are new records since both ids are required to create the association. #build raises since you can't associate an unsaved record. #create! takes an attributes hash and creates the associated record and its association in a transaction. [Jeremy Kemper] 
  • trunk/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb

    r4737 r4788  
     1 
    12require 'active_record/connection_adapters/abstract_adapter' 
    23 
     
    210211             AND t.relname = '#{table_name}' 
    211212             AND a.attrelid = t.oid 
    212              AND ( d.indkey[0]=a.attnum OR d.indkey[1]=a.attnum 
    213                 OR d.indkey[2]=a.attnum OR d.indkey[3]=a.attnum 
    214                 OR d.indkey[4]=a.attnum OR d.indkey[5]=a.attnum 
    215                 OR d.indkey[6]=a.attnum OR d.indkey[7]=a.attnum 
    216                 OR d.indkey[8]=a.attnum OR d.indkey[9]=a.attnum ) 
     213             AND a.attnum = ANY (d.indkey) 
    217214          ORDER BY i.relname 
    218215        SQL