TIMESTAMP difference

From: rihad <rihad(at)mail(dot)ru>
To: pgsql-general(at)postgresql(dot)org
Subject: TIMESTAMP difference
Date: 2007-12-10 19:13:42
Message-ID: 475D8FE6.9060504@mail.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi, is there a way to get the difference in hours between two
timestamps? The HH{1,}:MM:SS format will do.

foo=> select timestamp '20071211 00:00' - timestamp '20071210 00:01';
?column?
----------
23:59:00
(1 row)

foo=> select timestamp '20071211 00:00' - timestamp '20071209 01:00';
?column?
----------------
1 day 23:00:00
(1 row)

Any way to make it return "47:00:00" instead? select interval '47:00:00'
is still a legal interval as far as postgresql goes.

8.3-beta2 (can't get to beta4: freebsd ports are yet frozen :(

Thanks.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Carsten Franke 2007-12-10 19:15:37 Unable to ALTER table after SELECT data from table
Previous Message Thomas Carsten Franke 2007-12-10 19:13:09 Unable to ALTER table after SELECT data from table