Andreas Schmid <user462411(at)gmail(dot)com> writes:
> So my conclusion is that the result of UNION ALL depends on the column
> order, not on the column names or aliases. Is this the intended
> behaviour?
Yes, this is required by SQL spec. Matching by column name would
be used if you wrote a CORRESPONDING clause, but we don't implement
that feature.
regards, tom lane