Re: Interval month, week -> day

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org, pgsql-patches Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Interval month, week -> day
Date: 2006-09-01 00:16:28
Message-ID: 7E7C935A-31B5-405C-9D83-958C95A77647@seespotcode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


On Sep 1, 2006, at 9:12 , Tom Lane wrote:

> Michael Glaesemann <grzm(at)seespotcode(dot)net> writes:
>> I came across some behavior that seems counterintuitive to me:
>
>> test=# select '1.5 mon'::interval;
>> interval
>> -----------------
>> 1 mon 360:00:00
>> (1 row)
>
>> With the time/day/month interval struct introduced in 8.1, I'd expect
>> this to return '1 mon 15 days'. The reason is that the DecodeInterval
>> converts fractional months to time directly, rather than cascading
>> first to days.
>
> I agree that this seems like an oversight in the original
> months/days/seconds patch, rather than behavior we want to keep.
> But is DecodeInterval the only place with the problem? My
> recollection
> is that there's a certain amount of redundancy in the datetime
> code ...

I'll check on this tonight. Any idea where I might start to look?

Michael Glaesemann
grzm seespotcode net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-09-01 00:32:28 Re: Interval month, week -> day
Previous Message Tom Lane 2006-09-01 00:12:43 Re: Interval month, week -> day

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2006-09-01 00:32:28 Re: Interval month, week -> day
Previous Message Tom Lane 2006-09-01 00:12:43 Re: Interval month, week -> day