title: Invalid input syntax for type interval
body: <p>I am encountering an issue where I am not able to add intervals to a date in postgresql. In MySql I would do this:</p>
  
  <pre><code>date_add('2015-02-02', interval -46 day)
  </code></pre>
  
  <p>with the corresponding statement in postgresql being:</p>
  
  <pre><code>'2015-02-02' + -46 * interval '1 day'
  </code></pre>
  
  <p>But, when I do so I get an error of:</p>
  
  <pre><code>[Err] ERROR:  invalid input syntax for type interval: "2015-02-02"
  </code></pre>
  
  <p>If I remove the <code>+ -46 * interval '1 day'</code> section of the statement, it works as expected.</p>
  
  <p>The simplified query:</p>
  
  <pre><code>SELECT
      cd.date_sort_prequeue_start AS date,
      SUM(CASE WHEN cd.call_conclusion='Answered' THEN 1 ELSE 0 END) AS calls_answered
  FROM 
      data_warehouse.call_detail AS cd
      INNER JOIN data_warehouse.users_history AS uh ON cd.users_history_id=uh.id
  WHERE 
      cd.date_sort_prequeue_start&gt;= '2015-02-02' + (-46 * INTERVAL '1 day') 
      AND cd.date_sort_prequeue_start&lt;'2015-02-02' 
      AND cd.call_type='I' AND uh.team='TeamOne'
  GROUP BY 
      cd.date_sort_prequeue_start
  ORDER BY 
      cd.date_sort_prequeue_start;
  </code></pre>