Re: Why is a union of two null-results automatically casted to type text ? - Mailing list pgsql-general

From Frank van Vugt
Subject Re: Why is a union of two null-results automatically casted to type text ?
Date
Msg-id 200406161042.08842.ftm.van.vugt@foxi.nl
Whole thread Raw
In response to Re: Why is a union of two null-results automatically casted to type text ?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
> > But in a UNION ALL the distinctiveness isn't an issue, is it?

> True.  We do not currently distinguish UNION from UNION ALL as far as
> datatype assignment rules go

<cut>

> I'm not sure if it'd be a good idea to do so or not.  It'd
> make this particular example work the way you want, but otherwise it
> seems like making UNION ALL a special case would be a bit of a wart on
> the type system.

Well, in my case there's no situation where I don't know in advance where the
problem could occur, so it's easily avoided by proper typing of the first
null in the union all sequence.


Thanks for the explanation.






--
Best,




Frank.


pgsql-general by date:

Previous
From: Joolz
Date:
Subject: reference to a view
Next
From: Christophe Musielak
Date:
Subject: 7.4 performance issue