Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> you wish that in
> (select '1' union select '2') union select 3
> the fact that the third value is clearly integer would influence
> the choice of the resolved type of the first UNION.
> My vision of how to implement that is different than what you seem
> to have in mind, but it would come out with the same answer.
> The sticking point is just that in purely syntactic terms this is
> action-at-a-distance, and so it's hard to square with the spec. I
> think that our current reading (in which the '1' and '2' get
> resolved as text) is actually closer to what the spec says.
Would the approach you have in mind accept a query which is valid
under the spec yet return different results? If not, we can
legitimately call it an extension.
If we're not going to do that, there's probably some room to improve
our error reporting and/or documentation around this issue.
In response to
pgsql-bugs by date
|Next:||From: Kevin Grittner||Date: 2011-04-13 23:02:55|
|Subject: Re: BUG #5974: UNION construct type cast gives poor error message|
|Previous:||From: Tom Lane||Date: 2011-04-13 21:50:16|
|Subject: Re: BUG #5978: Running postgress in a shell script fails |