Zeugswetter Andreas SB <ZeugswetterA@Wien.Spardat.at> writes:
>> The UNION type-resolution code could use some work; right now I think
>> the algorithm is to use the types of the first SELECT and force
>> everything else into that.
> Imho this is expected behavior (maybe even standard).
Wrong. Read the spec (see 9.3 in SQL99).
regards, tom lane