title: Check if value exists in Postgres array
body: <p>Using Postgres 9.0, I need a way to test if a value exists in a given array. So far I came up with something like this:</p>
  
  <pre><code>select '{1,2,3}'::int[] @&gt; (ARRAY[]::int[] || value_variable::int)
  </code></pre>
  
  <p>But I keep thinking there should be a simpler way to this, I just can't see it. This seems better:</p>
  
  <pre><code>select '{1,2,3}'::int[] @&gt; ARRAY[value_variable::int]
  </code></pre>
  
  <p>I believe it will suffice. But if you have other ways to do it, please share!</p>