Re: [HACKERS] UNION result

2003-01-15 Thread Stephan Szabo
On Wed, 15 Jan 2003, Tom Lane wrote: > Stephan Szabo <[EMAIL PROTECTED]> writes: > > It seems to me that the spec has a fairly hardwired notion of what types > > should come out given the sql types. The biggest problems that I can > > see are that it doesn't extend well to an extensible type syst

Re: [HACKERS] UNION result

2003-01-15 Thread Tom Lane
Stephan Szabo <[EMAIL PROTECTED]> writes: > It seems to me that the spec has a fairly hardwired notion of what types > should come out given the sql types. The biggest problems that I can > see are that it doesn't extend well to an extensible type system and that > in alot of cases it doesn't seem

Re: [HACKERS] UNION result

2003-01-15 Thread Stephan Szabo
On Wed, 15 Jan 2003, Tom Lane wrote: > Stephan Szabo <[EMAIL PROTECTED]> writes: > > Hmm, I think (but am not sure) that the spec bit > > in SQL92 that addresses this is 9.3 > > Set operation result data types based on the > > text in 7.10 query expression. It seems > > to say to me that should a

Re: [HACKERS] UNION result

2003-01-15 Thread Tom Lane
Stephan Szabo <[EMAIL PROTECTED]> writes: > Hmm, I think (but am not sure) that the spec bit > in SQL92 that addresses this is 9.3 > Set operation result data types based on the > text in 7.10 query expression. It seems > to say to me that should always be an > approximate numeric (if 1.0 is an ap

Re: [HACKERS] UNION result

2003-01-14 Thread Stephan Szabo
On Wed, 15 Jan 2003, Tatsuo Ishii wrote: > Does anybody know: > > select 1.0 union select 1; > or > select 1 union select 1.0; > > should return 1 or 1.0? Hmm, I think (but am not sure) that the spec bit in SQL92 that addresses this is 9.3 Set operation result data types based on the text in 7.1

Re: [HACKERS] UNION result

2003-01-14 Thread Christopher Kings-Lynne
Seems fine to me - the second select being cast to the type of the first select. Chris > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Tatsuo Ishii > Sent: Wednesday, 15 January 2003 12:04 PM > To: [EMAIL PROTECTED] > Subjec

Re: [HACKERS] UNION result

2003-01-14 Thread Bruce Momjian
I think the cause is that multi-type UNION queries use the first query for casting the other parts of the UNION. In the old days we would just reject the query because the UNION columns are of different types. --- Tatsuo Is

[HACKERS] UNION result

2003-01-14 Thread Tatsuo Ishii
Does anybody know: select 1.0 union select 1; or select 1 union select 1.0; should return 1 or 1.0? I see below on my Linux box: test=# select 1 union select 1.0; ?column? -- 1 (1 row) test=# select 1.0 union select 1; ?column? -- 1.0 (1 row) This seems a lit