Subtracting Two Intervals

From: Terry Lee Tucker <terry(at)chosen-ones(dot)org>
To: Postgres General List <pgsql-general(at)postgresql(dot)org>
Subject: Subtracting Two Intervals
Date: 2008-04-07 18:11:26
Message-ID: 200804071411.26444.terry@chosen-ones.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In porting from 7.4.19 to 8.3.1 I have found the following:

7.4.19:
mwr=# select interval '1 day 15 hours 30 minutes' - interval '29 hours';
?column?
--------------------
@ 10 hours 30 mins
(1 row)

8.3.1:
mwr83=# select interval '1 day 15 hours 30 minutes' - interval '29 hours';
?column?
----------------------------
@ 1 day -13 hours -30 mins
(1 row)

Is that right? I mean if you take 1 day (24 hours) and add -13 hours and -30
minutes, you get 10 hours and 30 minutes, but is it supposed to display that
way?

TIA
--
Terry Lee Tucker
Turbo's IT Manager
Turbo, division of Ozburn-Hessey Logistics
2251 Jesse Jewell Pkwy NE
Gainesville, GA 30501
Tel: (336) 372-6812 Fax: (336) 372-6812 Cell: (336) 404-6987
terry(at)turbocorp(dot)com
www.turbocorp.com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Wilson 2008-04-07 18:27:42 Re: select distinct and index usage
Previous Message Joshua D. Drake 2008-04-07 17:57:34 Re: select distinct and index usage