query_column_constraints (SQL::Postgresql::Table)

    # File lib/dm-migrations/sql/postgresql.rb, line 50
          def query_column_constraints
            @adapter.query(
              "SELECT * FROM information_schema.table_constraints WHERE table_name='#{@name}' AND table_schema=current_schema()"
            ).each do |table_constraint|
              @adapter.query(
                "SELECT * FROM information_schema.constraint_column_usage WHERE constraint_name='#{table_constraint.constraint_name}' AND table_schema=current_schema()"
              ).each do |constrained_column|
                @columns.each do |column|
                  if column.name == constrained_column.column_name
                    case table_constraint.constraint_type
                    when "UNIQUE"       then column.unique = true
                    when "PRIMARY KEY"  then column.primary_key = true
                    end
                  end
                end
              end
            end
          end