Re: Why does this array query fail?

Поиск
Список
Период
Сортировка
От bricklen
Тема Re: Why does this array query fail?
Дата
Msg-id CAGrpgQ8xykA40nkovjDpvp1G9Q6HkTbc3KGc1quLmujWdcXV1Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: 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

On Mon, Sep 16, 2013 at 6:36 PM, Ken Tanzer <ken.tanzer@gmail.com> wrote:
Thanks for the explanation.  I think I at least understand what it's doing now.  I'm either surprised or confused though, as I was under the impression that you could substitute a subquery for a value pretty much anywhere, but I guess that's not the case?

Cheers,
Ken


Your subquery can also be explicitly casted to make it work. Note the "::TEXT[]"

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

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

Предыдущее
От: Ken Tanzer
Дата:
Сообщение: Re: Why does this array query fail?
Следующее
От: Ken Tanzer
Дата:
Сообщение: Re: Why does this array query fail?