On Thu, Aug 25, 2005 at 09:53:26AM +0100, THIBAULT Jean-Jacques wrote:
>
> this query work :
> select null UNION 1;
Please show the *exact* query. The above produces a syntax error:
test=> select null UNION 1;
ERROR: syntax error at or near "1" at character 19
LINE 1: select null UNION 1;
^
I suspect this is the actual query:
test=> select null UNION select 1;
?column?
----------
1
(2 rows)
> this query doesn't work :
> select null UNION null UNION 1;
>
> ERROR: UNION types text and integer cannot be matched
Again, the query as written causes a syntax error. This is probably
the actual query:
test=> select null UNION select null UNION select 1;
ERROR: UNION types text and integer cannot be matched
To understand what's happening, see "UNION, CASE, and ARRAY Type
Resolution" in the "Type Conversion" chapter of the documentation:
http://www.postgresql.org/docs/8.0/static/typeconv-union-case.html
--
Michael Fuhr