Elapsed time between timestamp variables in Function

Поиск
Список
Период
Сортировка
От Nico Callewaert
Тема Elapsed time between timestamp variables in Function
Дата
Msg-id EB846396B3254BAD98E7DB7BDE2AFEF6@etsinformatics.local
обсуждение исходный текст
Ответы Re: Elapsed time between timestamp variables in Function  (Raymond O'Donnell <rod@iol.ie>)
Re: Elapsed time between timestamp variables in Function  (Osvaldo Kussama <osvaldo.kussama@gmail.com>)
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Which is best, timestamp as float or integer ?
Следующее
От: "Adam Rich"
Дата:
Сообщение: Re: ramblings about password exposure (WAS: field with Password)