Re: Absolute value of intervals

Поиск
Список
Период
Сортировка
От Sam Mason
Тема Re: Absolute value of intervals
Дата
Msg-id 20091030141949.GZ5407@samason.me.uk
обсуждение исходный текст
Ответ на Re: Absolute value of intervals  (Marko Kreen <markokr@gmail.com>)
Ответы Re: Absolute value of intervals  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-general
On Fri, Oct 30, 2009 at 02:14:31PM +0200, Marko Kreen wrote:
> Slightly makes sense, but only slightly.  We deterministically know,
> that we dont have certain timestamp, thus we need to use some default
> values.  We already have situation that does that:
>
>   extract(epoch from interval)

You're arguing the same point as me.  Your extract code and my
comparison operator use exactly the same values as defaults when
normalizing their respective intervals.  Neither of them have anything
to do with timestamps.

> Yes, some cases the value returned is not the same value that would
> be added to a specific timestamp, but so what?  How is current situation
> better that we force users to manually create potentially buggy
> equivalent functionality?

Tom was arguing that it's fundamentally inappropriate to ask for the
absolute value of an interval.  I was saying that we've already chosen
arbitrary values for the components of an interval for comparison and
you've just pointed out that we use the same values elsewhere.  Once
we've chosen them I don't see why we shouldn't extend them to all the
places that they seem to fit, such as this absolute value operator.

I think the attached trivial bit code should do the right thing, however
I don't know what else is needed to hook everything up.

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

Вложения

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

Предыдущее
От: Guillaume Lelarge
Дата:
Сообщение: Re: checkpoints/bgwriter tuning verification
Следующее
От: Vick Khera
Дата:
Сообщение: Re: checkpoints/bgwriter tuning verification