Re: BUG #1107: Missing feature: interval <-> numeric quantity

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: PostgreSQL Bugs List <pgsql-bugs(at)postgresql(dot)org>
Cc: jozef(dot)behran(at)krs(dot)sk
Subject: Re: BUG #1107: Missing feature: interval <-> numeric quantity
Date: 2004-03-18 14:51:00
Message-ID: 20040318064620.J47930@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, 18 Mar 2004, PostgreSQL Bugs List wrote:

> Having two timestamps it is common need to know how many
> seconds/minutes/hours/days/etc. passed from one to the other. However there
> is no easy way to do this task.
>
> The basic idea is subtracting the two timestamps. However it gives a data
> type called "interval". The thing I would like to have is a function that
> takes the "interval" and outputs it's length. Currently when I want a

date_part('epoch', intervalval)
or
EXTRACT(EPOCH FROM intervalval)
gives the number of seconds in the interval as per the documentation of
these functions in the date/time functions and operators section of the
documentation.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2004-03-18 14:55:46 Re: BUG #1107: Missing feature: interval <-> numeric quantity
Previous Message Joe Sunday 2004-03-18 14:50:19 Re: BUG #1107: Missing feature: interval <-> numeric quantity conversion