Re: Why does this array query fail?

Поиск
Список
Период
Сортировка
От David Johnston
Тема Re: Why does this array query fail?
Дата
Msg-id 1379380561962-5771170.post@n5.nabble.com
обсуждение исходный текст
Ответ на Why does this array query fail?  (Ken Tanzer <ken.tanzer@gmail.com>)
Ответы Re: Why does this array query fail?  (Ken Tanzer <ken.tanzer@gmail.com>)
Список pgsql-general
Ken Tanzer wrote
> 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...
>                              ^

Per documentation of "ANY" it accepts either an array or a subquery.  This
is the subquery form.  PostgreSQL is trying to convert 'test' into an array
in order to match the array column returned by the subquery.

Remove the "SELECT" to make it work the way you expect - i.e., the
ANY(array) form of the expression.

David J.





--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Why-does-this-array-query-fail-tp5771165p5771170.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


В списке pgsql-general по дате отправления:

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: using Replace funcion in postgresql
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: using Replace funcion in postgresql