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

From Ryan Murphy
Subject [GENERAL] What's the best way in postgres to use ANY() with LIKE '%'?
Date
Msg-id CAHeEsBfQ79-ZOqWPTzFHVDpzbVX3uHktQOVAKAy-7huu7XzctQ@mail.gmail.com
Whole thread Raw
Responses Re: [GENERAL] What's the best way in postgres to use ANY() with LIKE '%'?  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: Steve Atkins
Date:
Subject: Re: [GENERAL] Create Action for psql when NOTIFY Recieved
Next
From: reugen1984@mail.ru
Date:
Subject: [GENERAL] hidden maintenance_work_mem limitations of a Windows build