title: PostgreSQL: Where clause using LIKE, ANY, and wildcards
body: <p>I have a table with a field containing an array of strings (type is <code>character varying(255)[]</code>). </p>
  
  <p>I'd like to compare a given string with a wildcard, say <code>'query%'</code>, to any of the elements of this field. </p>
  
  <p>This request works and gets back the expected results: </p>
  
  <pre><code>SELECT * FROM my_table WHERE 'query' ILIKE ANY(my_field)
  </code></pre>
  
  <p>But with the wildcard, I got no results: </p>
  
  <pre><code>SELECT * FROM my_table WHERE 'query%' ILIKE ANY(my_field)
  </code></pre>
  
  <p>I think the reason is that the wildcard is supported only at the right side of the <code>ILIKE</code> operator, but <code>ANY(my_field)</code> also has to be after the operator. </p>
  
  <p>Is there a way to achieve what I want?</p>
  
  <p>Using PostgreSQL 9.5.</p>