Re: BUG #1847: Error in some kind of UNION query. - Mailing list pgsql-bugs

From Andreas Pflug
Subject Re: BUG #1847: Error in some kind of UNION query.
Date
Msg-id 430DD203.4040507@pse-consulting.de
Whole thread Raw
In response to BUG #1847: Error in some kind of UNION query.  ("THIBAULT Jean-Jacques" <jjt4@wanadoo.fr>)
Responses Re: BUG #1847: Error in some kind of UNION query.
List pgsql-bugs
THIBAULT Jean-Jacques wrote:
> The following bug has been logged online:
>
> Bug reference:      1847
> Logged by:          THIBAULT Jean-Jacques
> Email address:      jjt4@wanadoo.fr
> PostgreSQL version: 8.0.3
> Operating system:   Linux (Mandrake)
> Description:        Error in some kind of UNION query.
> Details:
>
> this query work :
> select null UNION 1;
>
> this query doesn't work :
> select null UNION null UNION 1;
>
> ERROR:  UNION types text and integer cannot be matched

You probably mean
SELECT NULL
UNION
SELECT NULL
UNION
SELECT 1

Proper casting will help, insuring the correct type can be determined
from the first SELECT. Changing the order to have SELECT 1 does the job too.

Regards,
Andreas

pgsql-bugs by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: BUG #1847: Error in some kind of UNION query.
Next
From: Tom Lane
Date:
Subject: Re: BUG #1847: Error in some kind of UNION query.