Calculating the difference between timetz values

Поиск
Список
Период
Сортировка
От Alexey Klyukin
Тема Calculating the difference between timetz values
Дата
Msg-id 74F9F1F7-2F99-4984-8D3C-BD98511C97B6@commandprompt.com
обсуждение исходный текст
Ответы Re: Calculating the difference between timetz values
Список pgsql-general
Hello,

I was looking for a way to get the difference (interval) between 2
timetz values, i.e.:

postgres=# select '2:45+7'::timetz - '2:44+2'::timetz;
ERROR:  operator does not exist: time with time zone - time with time
zone
LINE 1: select '2:45+7'::timetz - '2:44+2'::timetz;

I'd expect the result of the above to be the interval of 05:01:00. Is
there any function or operator that calculates the difference
correctly ? I've found a way to cast a timetz to the time without TZ
and substract resulting time values, but it's not a correct solution
for the problem above due to the loss of all TZ information.

Regards,
--
Alexey Klyukin       http://www.CommandPrompt.com
The PostgreSQL Company - Command Prompt, Inc.


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

Предыдущее
От: "Jamie Lawrence-Jenner"
Дата:
Сообщение: Re: Postgres and multiple updates in one statement
Следующее
От: nha
Дата:
Сообщение: Re: Postgres and multiple updates in one statement