title: PostgreSQL interval subtraction
body: <p>I've tried to subtract interval from timestamp, but I've got a wrong result in comparison to days via subtracting 2 dates.</p>
  
  <p>E.g.:</p>
  
  <pre><code>select 
    (now::date - past::date) as days,
    (now::date - past::date) / 365.25 as years,
    justify_interval(now - past::date) as interval_test
  from (
    select '2020-09-17 00:00:01'::timestamp as now, '2010-09-17 00:00:01'::timestamp as past
  ) b;
  </code></pre>
  
  <p>gives results:</p>
  
  <ul>
  <li>3653 days</li>
  <li>10.0013 years</li>
  <li>'10 years <strong>1 mon 23 days</strong>' interval test</li>
  </ul>
  
  <p>Could anyone help me to understand what is wrong with subtracting?</p>
  
  <p>When I do it vice versa, it's ok:</p>
  
  <pre><code>select 
    (past::date + 3653)::date,
    (past + interval '10 years')::date,
    (past + 10*interval '1 year')::date,
    (past + 10*12*interval '1 month')::date
  from (
    select '2020-09-17 00:00:01'::timestamp as now, '2010-09-17 00:00:01'::timestamp as past
  ) b;
  </code></pre>
  
  <p>all results give the same date <strong>'2020-09-17'</strong></p>
  
  <p>What I do wrong?</p>
  
  <p>I am using PostgreSQL 10.5.</p>