def _columns(cursor, table):
    """Return the columns of a table as a list."""
    cursor.execute('''
        SELECT column_name FROM information_schema.columns WHERE table_schema = 'public' AND table_name = %s
    ''', (table, ))
    return [column['column_name'] for column in cursor.fetchall()]