Re: question about age()

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: question about age()
Дата
Msg-id 3976.1377808749@sss.pgh.pa.us
обсуждение исходный текст
Ответ на question about age()  (Andreas Kretschmer <akretschmer@spamfence.net>)
Ответы Re: question about age()  (Andreas Kretschmer <akretschmer@spamfence.net>)
Список pgsql-general
Andreas Kretschmer <akretschmer@spamfence.net> writes:
> '3 years' != '2 years 11 mons 30 days', but i got 0 rows, why?

Well, actually:

regression=# select '3 years'::interval = '2 years 11 mons 30 days'::interval;
 ?column?
----------
 t
(1 row)

IIRC, interval comparison operators normalize the two values assuming that
1 month = 30 days.  Which is kind of arbitrary, but without some such
assumption there's no way to have a scalar ordering of intervals at all.

            regards, tom lane


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

Предыдущее
От: Michael Nolan
Дата:
Сообщение: Re: question about age()
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: Why is NULL = unbounded for rangetypes?