title: pq: bind message supplies 1 parameters, but prepared statement "" requires 0
body: <p>I am trying to run a postgres if statement at my golang project, but i met this error, could you help me figure out?</p>
  <p>the code is</p>
  <pre><code>newDate := &quot;2022-06-22&quot;
  query := `
      DO $$
      DECLARE
      new_date date:= $1;
      BEGIN
      IF EXISTS (SELECT * FROM systemtable WHERE date = new_date) THEN
      UPDATE systemtable SET is_latest = TRUE WHERE date = new_date;
      ELSE
      INSERT INTO systemtable (date, is_latest) VALUES (new_date, TRUE);
      END IF;
      END$$;`
  
  if _, err := txi.Exec(query, newDate); err != nil {
      return err 
  }
  </code></pre>
  <p>Then the error returned is <code>&quot;pq: bind message supplies 1 parameters, but prepared statement &quot;&quot; requires 0&quot;</code></p>