Search Postgresql Archives

Why does this array query fail?

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

 



Hi.  Can someone explain to me why the last query below is failing, or what exactly the error message means?  I'm sure there's a simple reason, but I'm totally not seeing it.  I boiled this down from a more complicated example, but I think the problem is the same.  Thanks in advance.

Ken

ets_reach=> SELECT ARRAY['test','pass','fail'];
      array       
------------------
 {test,pass,fail}
(1 row)

ets_reach=> SELECT 'found' WHERE 'test' = ANY( ARRAY['test','pass','fail'] );
 ?column? 
----------
 found
(1 row)

ets_reach=> SELECT 'found' WHERE ARRAY['test','pass','fail'] = (SELECT ARRAY['test','pass','fail']);
 ?column? 
----------
 found
(1 row)

ets_reach=> SELECT 'found' WHERE 'test' = ANY( (SELECT ARRAY['test','pass','fail']) );

ERROR:  array value must start with "{" or dimension information
LINE 1: SELECT 'found' WHERE 'test' = ANY( (SELECT ARRAY['test','pas...
                             ^


--
AGENCY Software  
A data system that puts you in control
100% Free Software
http://agency-software.org/
ken.tanzer@xxxxxxxxxxxxxxxxxxx
(253) 245-3801

Subscribe to the mailing list to
learn more about AGENCY or
follow the discussion.

[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