= any((select )) needs cast, why?

Поиск
Список
Период
Сортировка
От Frank van Vugt
Тема = any((select )) needs cast, why?
Дата
Msg-id 201111121210.03296.ftm.van.vugt@foxi.nl
обсуждение исходный текст
Ответы Re: = any((select )) needs cast, why?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
L.S.

Could someone point me to the formal reason why in:

postgres=# select version();
                                        version
---------------------------------------------------------------------------------------
 PostgreSQL 9.0.4 on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC)
4.3.3, 64-bit
(1 row)


the cast to int[ ] of the result row is needed here:

postgres=# select 1 = any((select ARRAY[1,2])::int[]);
 ?column?
----------
 t
(1 row)


in order to avoid an error:

postgres=# select 1 = any((select ARRAY[1,2]));
ERROR:  operator does not exist: integer = integer[]
LINE 1: select 1 = any((select ARRAY[1,2]));
                 ^
HINT:  No operator matches the given name and argument type(s). You might need
to add explicit type casts.


Is the right hand side resulting in an array of an array or....?

--


Best,




Frank.

В списке pgsql-general по дате отправления:

Предыдущее
От: hubert depesz lubaczewski
Дата:
Сообщение: Re: Strange problem with create table as select * from table;
Следующее
От: Enrico Sirola
Дата:
Сообщение: Re: weird pg_statistic problem