Flowdock
method

can_perform_case_insensitive_comparison_for?

Importance_0
v5.1.7 - Show latest stable - 0 notes - Class: ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
can_perform_case_insensitive_comparison_for?(column) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb, line 796
        def can_perform_case_insensitive_comparison_for?(column)
          @case_insensitive_cache ||= {}
          @case_insensitive_cache[column.sql_type] ||= begin
            sql =               SELECT exists(                SELECT * FROM pg_proc                WHERE proname = 'lower'                  AND proargtypes = ARRAY[#{quote column.sql_type}::regtype]::oidvector              ) OR exists(                SELECT * FROM pg_proc                INNER JOIN pg_cast                  ON ARRAY[casttarget]::oidvector = proargtypes                WHERE proname = 'lower'                  AND castsource = #{quote column.sql_type}::regtype              )
            execute_and_clear(sql, "SCHEMA", []) do |result|
              result.getvalue(0, 0)
            end
          end
        end
Register or log in to add new notes.