Re: how to add 'time with time zone' data types and 'interval' data types

Поиск
Список
Период
Сортировка
От avpro avpro
Тема Re: how to add 'time with time zone' data types and 'interval' data types
Дата
Msg-id CAAQdDnnk2k74KyzThg2Jdngwk+a9s_2Q7_hSmz-ySURKNZkx8Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: how to add 'time with time zone' data types and 'interval' data types  (Kevin Grittner <kgrittn@ymail.com>)
Ответы Re: how to add 'time with time zone' data types and 'interval' data types  (David Johnston <polobo@yahoo.com>)
Список pgsql-novice
hi,

I'm using version 9.3.

sorry for this awkwardness; I'm not sure anymore what I've done.

select '12:00'::time - '9:00'::time;
is working;

however, I was looking to use the 'time with time zone' capability:
when I run:

select '19:00:00+01'::timetz - '12:00:00+02'::timetz;

i get:

ERROR:  operator does not exist: time with time zone - time with time zone
LINE 1: select '19:00:00+01'::timetz - '12:00:00+02'::timetz;
                                     ^
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.
********** Error **********

ERROR: operator does not exist: time with time zone - time with time zone
SQL state: 42883
Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
Character: 30

how this works? where I could find more documentation?
what about the Cast aliases? where could I find them?

thanks once more for your input




On 7 January 2014 17:16, Kevin Grittner <kgrittn@ymail.com> wrote:
avpro avpro <avprowebeden@gmail.com> wrote:

> select '12:00'::time - '9:00'::time; didn't work.

I get this on 9.3:

test=# select '12:00'::time - '9:00'::time;
 ?column?
----------
 03:00:00

(1 row)
What version are you using?  What happens when you try it?

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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

Предыдущее
От: Sergey Konoplev
Дата:
Сообщение: Re: Master-slave failover question
Следующее
От: David Johnston
Дата:
Сообщение: Re: how to add 'time with time zone' data types and 'interval' data types