@reflection.cache
    def get_indexes(self, connection, table_name, schema, **kw):
        table_oid = self.get_table_oid(connection, table_name, schema,
                                       info_cache=kw.get('info_cache'))

        # cast indkey as varchar since it's an int2vector,
        # returned as a list by some drivers such as pypostgresql

        IDX_SQL = """
          SELECT
              i.relname as relname,
              ix.indisunique, ix.indexprs, ix.indpred,
              a.attname, a.attnum, ix.indkey%s
          FROM
              pg_class t
                    join pg_index ix on t.oid = ix.indrelid
                    join pg_class i on i.oid=ix.indexrelid
                    left outer join
                        pg_attribute a
                        on t.oid=a.attrelid and %s
          WHERE
              t.relkind = 'r'
              and t.oid = :table_oid
              and ix.indisprimary = 'f'
          ORDER BY
              t.relname,
              i.relname
        """ % (
            # version 8.3 here was based on observing the
            # cast does not work in PG 8.2.4, does work in 8.3.0.
            # nothing in PG changelogs regarding this.
            "::varchar" if (8, 3) >= self.server_version_info else "",
            self._pg_index_any("a.attnum", "ix.indkey")
        )

        t = sql.text(IDX_SQL, typemap={'attname': sqltypes.Unicode})
        c = connection.execute(t, table_oid=table_oid)

        indexes = defaultdict(lambda: defaultdict(dict))

        sv_idx_name = None
        for row in c.fetchall():
            idx_name, unique, expr, prd, col, col_num, idx_key = row

            if expr:
                if idx_name != sv_idx_name:
                    util.warn(
                        "Skipped unsupported reflection of "
                        "expression-based index %s"
                        % idx_name)
                sv_idx_name = idx_name
                continue

            if prd and not idx_name == sv_idx_name:
                util.warn(
                    "Predicate of partial index %s ignored during reflection"
                    % idx_name)
                sv_idx_name = idx_name

            index = indexes[idx_name]
            if col is not None:
                index['cols'][col_num] = col
            index['key'] = [int(k.strip()) for k in idx_key.split()]
            index['unique'] = unique

        return [
            {'name': name,
             'unique': idx['unique'],
             'column_names': [idx['cols'][i] for i in idx['key']]}
            for name, idx in indexes.items()
        ]
dataset/ETHPy150Open RoseOu/flasky/venv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.py/PGDialect.get_indexes/swapped operands of `>=`