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

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-16 08:42:08
Message-ID: 200406161042.08842.ftm.van.vugt@foxi.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Christophe Musielak 2004-06-16 09:07:50 7.4 performance issue
Previous Message Joolz 2004-06-16 08:41:10 reference to a view