Time handling in pgsql.

From: "Jeff MacDonald" <jeff(at)interchange(dot)ca>
To: "Pgsql-General(at)Postgresql(dot) Org" <pgsql-general(at)postgresql(dot)org>
Subject: Time handling in pgsql.
Date: 2003-04-21 20:31:19
Message-ID: FJENKCLABGGBKBDGHOJJKEPBCAAA.jeff@interchange.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I have a table like so.

create table times (
start datetime,
end datetime,
estimate fload);

I'd like to be able to do something like this

SELECT estimate::timestamp - (end-start) from times;

anyone have some suggestions ?

When i do "select end-start from times" it formats
the text in such a way that it's like this

"1 days 2:33:03:00"

is there a way taht i can cast that to say "x seconds"
or 26:33:03:00 something like that is much more plesant
to parse than the 1 days format.

Thanks.

Jeff.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message enediel 2003-04-21 20:56:53 postgresql doesn't start
Previous Message scott.marlowe 2003-04-21 20:30:12 Re: > 16TB worth of data question