title: Psycopg2 "operator does not exist: integer[] = integer" error
body: <p>Given a table called <code>namespace_list</code> with an <code>INTEGER[]</code> column called <code>namespace_ids</code>.</p>
  
  <p>I have the following query:</p>
  
  <pre><code>query = SELECT * FROM namespace_list WHERE namespace_ids = ANY(%s) 
  and application_id=%s
  </code></pre>
  
  <p>which I am executing as:</p>
  
  <pre><code>cur.execute(query, data)
  </code></pre>
  
  <p>and where data is:</p>
  
  <pre><code>data = ([1, 2], 1)
  </code></pre>
  
  <p>I am getting the following error:</p>
  
  <pre><code>operator does not exist: integer[] = integer at character 50\nHINT:
  No operator matches the given name and argument type(s).
  You might need to add explicit type casts.
  </code></pre>
  
  <p>Why is this not working? Looking at <a href="http://www.postgresql.org/message-id/CAG7mmoxZdRdatjWSYLBCVGJ4CPMa38ARSZByWe9xrWHKP0mB1g@mail.gmail.com" rel="nofollow">http://www.postgresql.org/message-id/CAG7mmoxZdRdatjWSYLBCVGJ4CPMa38ARSZByWe9xrWHKP0mB1g@mail.gmail.com</a>, and other tutorials on Postgres Arrays, it seems that I have the correct query.</p>
  
  <p>I am following what <a href="http://initd.org/psycopg/docs/usage.html#adapt-list" rel="nofollow">http://initd.org/psycopg/docs/usage.html#adapt-list</a> has as an example as well. Is there anything wrong with my query, or the way I am using arrays with psycopg2?</p>