Search Postgresql Archives

<int> = any((select <int[]>)) needs cast, why?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux