Re: union of types in a different category

Поиск
Список
Период
Сортировка
От James Harper
Тема Re: union of types in a different category
Дата
Msg-id 6035A0D088A63A46850C3988ED045A4B6F3B0219@BITCOM1.int.sbss.com.au
обсуждение исходный текст
Ответ на Re: union of types in a different category  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: union of types in a different category
Следующее
От: Jov
Дата:
Сообщение: stand by is starting until I do some work in the primary