[GENERAL] What's the best way in postgres to use ANY() with LIKE '%'?

Поиск
Список
Период
Сортировка
От Ryan Murphy
Тема [GENERAL] What's the best way in postgres to use ANY() with LIKE '%'?
Дата
Msg-id CAHeEsBfQ79-ZOqWPTzFHVDpzbVX3uHktQOVAKAy-7huu7XzctQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: [GENERAL] What's the best way in postgres to use ANY() with LIKE '%'?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
e.g. I know you can do

select * from post
where 'music' = any(tags);

Which is similar to saying tags @> '{music}'.

And I see that I can even do:

select * from post
where 'music' LIKE any(tags);

...implying that ANY is more general in some ways than @>,
e.g. it can would with LIKE as well as =.

But is there any way to do:

select * from post
where any(tags) LIKE 'music%';

??

This doesn't work because ANY is only allowed on the right.

Thanks!
Ryan

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

Предыдущее
От: Steve Atkins
Дата:
Сообщение: Re: [GENERAL] Create Action for psql when NOTIFY Recieved
Следующее
От: reugen1984@mail.ru
Дата:
Сообщение: [GENERAL] hidden maintenance_work_mem limitations of a Windows build