Re: '1 year' = '360 days' ????

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: '1 year' = '360 days' ????
Дата
Msg-id
4333.1098581895@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
'1 year' = '360 days' ???? "Ricardo Perez Lopez" <ricpelo@hotmail.com>
Re: '1 year' = '360 days' ???? Bruno Wolff III <bruno@wolff.to>
Re: '1 year' = '360 days' ???? Tom Lane <tgl@sss.pgh.pa.us>
Re: '1 year' = '360 days' ???? Doug McNaught <doug@mcnaught.org>
Re: '1 year' = '360 days' ???? Tom Lane <tgl@sss.pgh.pa.us>
Re: '1 year' = '360 days' ???? Bruno Wolff III <bruno@wolff.to>
Re: '1 year' = '360 days' ???? Tom Lane <tgl@sss.pgh.pa.us>
Re: '1 year' = '360 days' ???? Bruno Wolff III <bruno@wolff.to>
Re: '1 year' = '360 days' ???? Bruno Wolff III <bruno@wolff.to>
Re: '1 year' = '360 days' ???? Bruno Wolff III <bruno@wolff.to>
Re: '1 year' = '360 days' ???? Tom Lane <tgl@sss.pgh.pa.us>
Re: '1 year' = '360 days' ???? Guy Fraser <guy@incentre.net>
Re: '1 year' = '360 days' ???? Pierre-Frédéric Caillaud<lists@boutiquenumerique.com>
Re: '1 year' = '360 days' ???? Michael Glaesemann <grzm@myrealbox.com>
Re: '1 year' = '360 days' ???? Tom Lane <tgl@sss.pgh.pa.us>
Re: '1 year' = '360 days' ???? Bruno Wolff III <bruno@wolff.to>
Re: '1 year' = '360 days' ???? Guy Fraser <guy@incentre.net>
Re: '1 year' = '360 days' ???? Bruno Wolff III <bruno@wolff.to>
Re: '1 year' = '360 days' ???? Gaetano Mendola <mendola@bigfoot.com>
Re: '1 year' = '360 days' ???? Guy Fraser <guy@incentre.net>
Doug McNaught  writes:
> template1=# select '1 year'::interval = '360 days'::interval;
>  ?column? 
> ----------
>  t
> (1 row)

Yeah, if you look at interval_cmp_internal() it's fairly obvious why.
I think that this definition is probably bogus, and that only intervals
that match exactly (equal months parts *and* equal seconds parts) should
be considered "equal".  However the most obvious way to redefine it
(compare the months, and only if equal compare the seconds) would lead
to rather nonintuitive behaviors such as "'1 year' > '1000 days'".
Anybody have any thoughts about a better way to map the multicomponent
reality into a one-dimensional sorting order?

(Note also that as Bruno was just mentioning, we really ought to have
months/days/seconds components, not just months/seconds; which makes the
comparison issue even more interesting.)

			regards, tom lane
В списке pgsql-general по дате отправления
От: Scott Marlowe
Дата:
От: Bruno Wolff III
Дата:
Сообщение: Re: '1 year' = '360 days' ????
FAQ