title: golang syntax error at or near "$1" in postgres
body: <p>I am trying to execute a query in go using the sql module.</p>
  
  <pre><code>var from string = "2015-03-01 00:00:00"    
  rows, err := db.Query("select time, val from table where " +
                                "time &gt;= extract(epoch from timestamp with time zone $1)::int4 " +
                                "and time &lt; extract(epoch from timestamp with time zone '2015-03-01 00:15:10')::int4 " +
                                "order by time asc",from)
  </code></pre>
  
  <p>However I get the error </p>
  
  <pre><code>pq: syntax error at or near "$1"
  </code></pre>
  
  <p>If I put in the epoch values directly then the query will work and the query works when I try it without any variables i.e. with the query hardcoded.
  So what is the problem?</p>