Re: TIME ZONE SQL

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: TIME ZONE SQL
Дата
Msg-id 3968.1076000055@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: TIME ZONE SQL  ("Raman Garg" <ramang@smartdatainc.com>)
Список pgsql-sql
"Raman Garg" <ramang@smartdatainc.com> writes:
> Actually my "between" is creating some problems and is not giving me results
> so what I have done is . IN MY WHERE CLAUSE OF QUERY:

I suspect that this revised clause will give you problems too, namely
selecting rows you don't want.

I think what may actually be happening here is that you have times
wrapping around past midnight.  For instance consider

regression=# select '10:30'::time + '15 hours'::interval;?column?
----------01:30:00
(1 row)

regression=# select '10:30'::time - '15 hours'::interval;?column?
----------19:30:00
(1 row)

It seems to me that your approach to the problem is all wrong, and you
need to be using timestamp-based calculations not time-of-day-based
calculations.
        regards, tom lane


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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: TIME ZONE SQL
Следующее
От: Chris Anderson
Дата:
Сообщение: Could not convert UTF-8 to ISO8859-1