call the method connection.introspection.get_relations with 2 arguments cursor, table_name and substitute the result for indexes.
indexes = connection . introspection . get_indexes ( cursor , table_name )