Why does this array query fail?

Поиск
Список
Период
Сортировка
От Ken Tanzer
Тема Why does this array query fail?
Дата
Msg-id CAD3a31Vm-igVMNJGf0co1iPVgZQBZMiJUciDmod_8EQiUqj3bQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: Why does this array query fail?  (bricklen <bricklen@gmail.com>)
Re: Why does this array query fail?  (David Johnston <polobo@yahoo.com>)
Список 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 по дате отправления:

Предыдущее
От: NWRFC Portland
Дата:
Сообщение: Re: Postgres 9.2.4 "Double Precision" Precision
Следующее
От: karinos57
Дата:
Сообщение: using Replace funcion in postgresql