def _columnExists(cursor, name, colname):
    """Tests whether a column exists in a table."""
    schemaname, tablename = name.split(".")
    sql = "select column_name from information_schema.columns where table_schema='{0}' and table_name='{1}' and column_name='{2}'".format(
        schemaname, tablename, colname)
    cursor.execute(sql)
    return bool(cursor.rowcount)