def clear_view(connection, view_name, materialized=False):
    """
    Remove a named view on connection.
    """
    cursor_wrapper = connection.cursor()
    cursor = cursor_wrapper.cursor
    try:
        if materialized:
            cursor.execute('DROP MATERIALIZED VIEW IF EXISTS {0} CASCADE'.
                format(view_name))
        else:
            cursor.execute('DROP VIEW IF EXISTS {0} CASCADE'.format(view_name))
    finally:
        cursor_wrapper.close()
    return 'DROPPED'.format(view=view_name)
