title: Error: No operator matches the given name and argument type(s)
body: <p>I have a model called <code>Group</code>, and another called <code>Reply</code> that contains an attribute which is a foreignkey to <code>Group</code>. This attribute is named <code>which_group</code>.</p>
  
  <p>Next, to a queryset of Group objects, I annotated a related object called <strong>latest</strong>, which is simply the <code>Max(reply__id)</code> related to each object. This resulting queryset I called <strong>groups</strong>.</p>
  
  <p>Next I did the following:</p>
  
  <pre><code> values = tuple([(group.id, group.latest) for group in groups])
   replies = Reply.objects.extra(where=['(which_group_id,id) IN %s' % (values)])
   replies = list(replies)
   return replies
  </code></pre>
  
  <p>I tested this code with a user who had 1 object in <strong>groups</strong>. It returned me an error: </p>
  
  <p><strong>operator does not exist: record = integer
  LINE 1: ...se" FROM "links_reply" WHERE ((which_group_id,id) IN (1, 52)...
                                       ^
  HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.</strong></p>
  
  <p>How do I fix this?</p>
  
  <p><em>p.s. my DB is Postgres (it's known to be "strongly typed")</em></p>