"Tom Lane" <tgl@sss.pgh.pa.us> writes:
> Gregory Stark <stark@enterprisedb.com> writes:
>
>> Does it even matter except in the case of nulls? I mean, if the inner pair
>> uses integer and then the outer pair uses bigint it'll still work correctly,
>> no?
>
> Oh, it absolutely matters: you can get different answers. Consider
>
> (select '1' union select ' 1') union all select 1;
Ah.
>> What would happen if the inner pair defaulted null to "unknown" instead of
>> text?
>
> You're missing the point, which is that the inner UNION needs to decide
> what its uniqueness semantics are, independently of what might happen to
> its result later. Or that's how I read the spec anyway.
Ah of course. We wouldn't be able to unionize "unknown" all. hmph.
-- Gregory Stark EnterpriseDB http://www.enterprisedb.com