Re: Absolute value of intervals

Поиск
Список
Период
Сортировка
От Sam Mason
Тема Re: Absolute value of intervals
Дата
Msg-id 20091030112513.GX5407@samason.me.uk
обсуждение исходный текст
Ответ на Re: Absolute value of intervals  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Absolute value of intervals
Список pgsql-general
On Fri, Oct 30, 2009 at 12:55:51AM -0400, Tom Lane wrote:
> Jeff Davis <pgsql@j-davis.com> writes:
> > Yes, that is a strange case. When you can't tell if an interval is
> > positive or negative, how do you define the absolute value?
>
> That was the point of my '1 day -25 hours' example.  Whether you
> consider that positive or negative seems mighty arbitrary.

My personal feeling is that when you provide any ordering operator and
negation you can easily provide an absolute value operator.  We've
already (somewhat arbitrarily) decided that one of '1month -30days' and
'-1month 30days) is "greater" than the other, so why not provide an
operator that returns the "greater" of an interval value and its own
negation?

--
  Sam  http://samason.me.uk/

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

Предыдущее
От: Steve Clark
Дата:
Сообщение: Re: checkpoints/bgwriter tuning verification
Следующее
От: Marko Kreen
Дата:
Сообщение: Re: Absolute value of intervals