Interval subtracting

From: Milorad Poluga <milorad(dot)poluga(at)cores(dot)co(dot)yu>
To: pgsql-sql(at)postgresql(dot)org
Subject: Interval subtracting
Date: 2006-02-18 13:44:05
Message-ID: 200602181444.06009.milorad.poluga@cores.co.yu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches pgsql-sql

Hi all,

Is there something incorrect in the above query ?
SELECT '10 years 1 mons 1 days'::interval - '9 years 10 mons 15 days'::interval

?column?
---------------
3 mons -14 days

Why not '2 mons 16 days' ?

/version = PostgreSQL 8.0.4 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.4.2 20041017 (Red Hat 3.4.2-6.fc3) /

Thanks a lot,
Milorad Poluga
-------------------------------
milorad(dot)poluga(at)cores(dot)co(dot)yu

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Milen A. Radev 2006-02-18 14:24:39 Re: Interval subtracting
Previous Message Andrew Dunstan 2006-02-18 11:49:41 Re: Updated email signature

Browse pgsql-patches by date

  From Date Subject
Next Message Milen A. Radev 2006-02-18 14:24:39 Re: Interval subtracting
Previous Message Marko Kreen 2006-02-18 00:23:45 pgcrypto: fix memory leak in openssl.c

Browse pgsql-sql by date

  From Date Subject
Next Message Milen A. Radev 2006-02-18 14:24:39 Re: Interval subtracting
Previous Message Greg Stark 2006-02-18 07:58:03 Re: Tough Problem -- Record Checkouts