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