Re: union of types in a different category - Mailing list pgsql-general

From James Harper
Subject Re: union of types in a different category
Date
Msg-id 6035A0D088A63A46850C3988ED045A4B6F3B0219@BITCOM1.int.sbss.com.au
Whole thread Raw
In response to Re: union of types in a different category  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
> Did you try it?
>
> postgres=# SELECT '1' UNION SELECT 2;
>  ?column?
> ----------
>         1
>         2
> (2 rows)
>
> Now, if I'd done this it would fail:
>
> postgres=# SELECT '1'::text UNION SELECT 2;
> ERROR:  UNION types text and integer cannot be matched
> LINE 1: SELECT '1'::text UNION SELECT 2;
>                                       ^

I did try it, but probably only in the latter form through a query translator I'm working on, and also SELECT 'X' UNION
SELECT1, hoping that they would cast implicitly to a string. 

Sorry for the confusion and thanks for the response!

James


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: union of types in a different category
Next
From: Jov
Date:
Subject: stand by is starting until I do some work in the primary