def exists_table(connection, table):
    """Check whether table exists
    :param table: name of table
    :returns: bool
    """
    cursor = connection.cursor()
    cursor.execute('SELECT 1 FROM "SYS"."TABLES" WHERE "TABLE_NAME" = %s', (table,))
    return cursor.fetchone() is not None