Re: Broken(?) 'interval' problems. [Was: ISO 8601 "Time Intervals"]

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Broken(?) 'interval' problems. [Was: ISO 8601 "Time Intervals"]
Дата
Msg-id 20030911002119.GA976@wolff.to
обсуждение исходный текст
Ответ на Re: Broken(?) 'interval' problems. [Was: ISO 8601 "Time Intervals"]  ("Ron Mayer" <ron@intervideo.com>)
Ответы Re: Broken(?) 'interval' problems. [Was: ISO 8601 "Time Intervals"]  ("Ron Mayer" <ron@intervideo.com>)
Список pgsql-hackers
On Wed, Sep 10, 2003 at 15:43:56 -0700, Ron Mayer <ron@intervideo.com> wrote:
> Bruno wrote:
> > 
> > Can you document which part of a mixed interval (with both months and
> > seconds parts) gets added first to a timestamp? I haven't ever run
> > across anything which says which gets done first.
> > 
> 
> In the existing code, the sql spec, or the proposed implementation?

In whatever is going to get implemented.

> In the existing code, I think everything with "+" gets done
> in in the same order (left-to-right?), regardless of if the
> fields are timestamps or intervals.

That isn't what I was asking about. An interval has two parts. One
part is the number of months in the interval and the other part is
the number of seconds (or perhaps milliseconds). Often a single interval
will only have one of these parts be nonzero. However if both parts are
nonzero it makes a difference in which part gets added first.
For example '2003-02-28'::date + '1 month 1 day'::interval might
be either 2003-03-29 or 2003-04-01. In 7.4 it is currently 2003-03-29,
but since it isn't documented it isn't clear if that will be true
in future versions.


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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: massive quotes?
Следующее
От: Philip Yarra
Дата:
Сообщение: Re: Unixware Patch (Was: Re: Beta2 Tag'd and Bundled ...)