

def get_indexes(cursor, table_name):
    "\n    Returns a dictionary of fieldname -> infodict for the given table,\n    where each infodict is in the format:\n        {'primary_key': boolean representing whether it's the primary key,\n         'unique': boolean representing whether it's a unique index}\n    "
    table_name.execute('\n        SELECT attr.attname, idx.indkey, idx.indisunique, idx.indisprimary\n        FROM pg_catalog.pg_class c, pg_catalog.pg_class c2,\n            pg_catalog.pg_index idx, pg_catalog.pg_attribute attr\n        WHERE c.oid = idx.indrelid\n            AND idx.indexrelid = c2.oid\n            AND attr.attrelid = c.oid\n            AND attr.attnum = idx.indkey[0]\n            AND c.relname = %s', [table_name])
    indexes = {
        
    }
    for row in cursor.fetchall():
        if (' ' in row[1]):
            continue
        indexes[row[0]] = {
            'primary_key': row[3],
            'unique': row[2],
        }
    return indexes

dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-0.96/django/db/backends/postgresql/introspection.py get_indexes/VarMisuse@14/109 `cursor`->`table_name`