This visit method should live in ExpressionCompiler and we should have a new Expression like ArrayConstructorExpression which gets returned by it. For the case of UPSERT VALUES, it needs to be a constant expression (the above mentioned code checks that), but it could be used in a SELECT clause too to create an ARRAY. For example, this should work:

    SELECT * FROM t WHERE my_array = ARRAY [ 'a', my_column, 'b']

So the evaluate method would look through the child expressions and evaluate each one of them to produce the Array. One tricky bit is that this ArrayConstructorExpression would need to worry about "partial" evaluation. We can talk about this once you have the basic stuff working.