| From: | Frank van Vugt <ftm(dot)van(dot)vugt(at)foxi(dot)nl> | 
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> | 
| Cc: | pgsql-general(at)postgresql(dot)org | 
| Subject: | Re: Why is a union of two null-results automatically casted to type text ? | 
| Date: | 2004-06-15 14:40:09 | 
| Message-ID: | 200406151640.09703.ftm.van.vugt@foxi.nl | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general | 
> > I'm wondering about the reason this cast to text takes place,
>
> UNION requires assignment of a definite type to the inputs, because
> otherwise there's no certainty that we know how to identify distinct
> and non-distinct values.  The alternative to assigning TEXT is to
> reject the inner UNION outright :-(
Ah, thanks Tom.
No, I think I'll go for the current implementation instead ;)
But in a UNION ALL the distinctiveness isn't an issue, is it?
So why is this failing as well:
	select 1 union select * from (select null union all select null) as foo;
I strolled through chapters 8 and 10 of the docs ('data types' and 'type 
conversion') earlier, is there some additional source of information that 
describes the way PostgreSQL handles typing, specifically things like what 
you're describing here? Other than the source that is... 
-- 
Best,
Frank.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Chris Ochs | 2004-06-15 14:52:21 | Feature idea | 
| Previous Message | D. Stimits | 2004-06-15 14:20:21 | how does license work for non-profit companies? |