Re: Elapsed time between timestamp variables in Function

From: "Nico Callewaert" <callewaert(dot)nico(at)telenet(dot)be>
To: "Osvaldo Kussama" <osvaldo(dot)kussama(at)gmail(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Elapsed time between timestamp variables in Function
Date: 2009-02-05 10:01:21
Message-ID: 123829DC90B54B97B738E47B2193EC03@etsinformatics.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks a lot to everybody for the help !

----- Original Message -----
From: "Osvaldo Kussama" <osvaldo(dot)kussama(at)gmail(dot)com>
To: "Nico Callewaert" <callewaert(dot)nico(at)telenet(dot)be>
Cc: <pgsql-general(at)postgresql(dot)org>
Sent: Thursday, February 05, 2009 2:59 AM
Subject: Re: [GENERAL] Elapsed time between timestamp variables in Function

> 2009/2/4 Nico Callewaert <callewaert(dot)nico(at)telenet(dot)be>:
>> Hi !
>>
>> I saw previous postings about elapsed time between 2 timestamps, using
>> SELECT EXTRACT...
>> I have similar question, but it's not in a select statement, but between
>> 2
>> variables in a function.
>>
>> To keep it simple, I have 2 variables, let's say A and B, both TimeStamp.
>> Now I would like to know the absolute value of elapsed seconds between
>> the 2
>> timestamps. Has to be absolute value, because can be positive or
>> negative,
>> depends if A > B or A < B.
>> I tried with age(A, B), but that gives me something like 00:00:01, not
>> really numeric value for number of seconds.
>>
>> Many thanks in advance !
>> Nico
>
>
> EXTRACT(EPOCH FROM age(A,B)) ?
>
> Osvaldo
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Karsten Hilbert 2009-02-05 10:21:30 Re: Automatic database upgrade
Previous Message Thom Brown 2009-02-05 09:49:38 Automatic database upgrade