Why does this array query fail? - Mailing list pgsql-general

From Ken Tanzer
Subject Why does this array query fail?
Date
Msg-id CAD3a31Vm-igVMNJGf0co1iPVgZQBZMiJUciDmod_8EQiUqj3bQ@mail.gmail.com
Whole thread Raw
Responses Re: Why does this array query fail?  (bricklen <bricklen@gmail.com>)
Re: Why does this array query fail?  (David Johnston <polobo@yahoo.com>)
List pgsql-general
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
(253) 245-3801

learn more about AGENCY or
follow the discussion.

pgsql-general by date:

Previous
From: NWRFC Portland
Date:
Subject: Re: Postgres 9.2.4 "Double Precision" Precision
Next
From: karinos57
Date:
Subject: using Replace funcion in postgresql