Search Postgresql Archives

= ANY (SELECT ..) and type casts, what's going on here?

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

 



Hi,

Is anybody able to explain the following behaviour?

Server is 8.4.7  RHEL5 build.  Also happens on 8.4.8 Ubuntu x64 package.

mr-russ=# SELECT 'BU'::varchar = ANY ((select '{BU,CI}'::varchar[]));
ERROR:  operator does not exist: character varying = character varying[]
LINE 1: SELECT 'BU'::varchar = ANY ((select '{BU,CI}'::varchar[]));
                             ^
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.
mr-russ=# SELECT 'BU'::varchar = ANY ((select '{BU,CI}'::varchar[])::varchar[]);
 ?column?
----------
 t
(1 row)

mr-russ=#


What I don't understand is what happens to the single SELECT's type, is it because select returns a row?  The error doesn't seem to match what I would expect?

Thanks

Russell

-- 
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