title: Comparing field to placeholder - PostgreSQL
body: <p>I am using Go to execute a query on a PostgreSQL DB. Note that in the DB <code>id</code> is type <code>bigint</code>.</p>
  
  <pre><code>db.Exec("UPDATE tags SET association_count = association_count - 1 WHERE id=?;", id)
  </code></pre>
  
  <p>When I run this code, I get a SQL error</p>
  
  <pre><code>operator does not exist: bigint =?
  </code></pre>
  
  <p>From what I can tell this is caused by a typing mismatch between the <code>id</code> and the <code>?</code>. I've tried casting with <code>::</code> but it throws an error, and haven't found anything about this. Interestingly, if there is a space, like <code>id = ?</code> it throws a general syntax error. Any idea how to cast or work around this?</p>