title: Postgres invalid input syntax for type json Detail: Token "%" is invalid
body: <p>I'm trying to check if some text contains the concatenation of a text and a value from an array in Postgres, something like:</p>
  
  <pre><code>SELECT true from jsonb_array_elements('["a", "b"]'::jsonb) as ids 
  WHERE 'bar/foo/item/b' LIKE '%item/' || ids-&gt;&gt;'id' || '%'
  </code></pre>
  
  <p>I'm getting the following error:</p>
  
  <pre><code>ERROR: invalid input syntax for type json Detail: Token "%" is invalid. Position: 95 Where: JSON data, line 1: %...
  </code></pre>
  
  <p>How can I make use of the values of the array, concatenate them with the text and check the <code>LIKE</code> expression?</p>
  
  <p>I have tried several ideas of explicitly adding a cast like <code>::jsonb</code>, but no luck so far. </p>