On Wed, Sep 10, 2003 at 15:43:56 -0700,
  Ron Mayer <[EMAIL PROTECTED]> 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.

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Reply via email to