Skip site navigation (1) Skip section navigation (2)

Re: Interval month, week -> day

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgresql(dot)org, Michael Glaesemann <grzm(at)seespotcode(dot)net>
Cc: pgsql-patches Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Interval month, week -> day
Date: 2006-09-01 00:12:43
Message-ID: 26490.1157069563@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
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 ...

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Michael GlaesemannDate: 2006-09-01 00:16:28
Subject: Re: Interval month, week -> day
Previous:From: Tom LaneDate: 2006-09-01 00:01:49
Subject: Re: GRANT role docs inconsistency

pgsql-patches by date

Next:From: Michael GlaesemannDate: 2006-09-01 00:16:28
Subject: Re: Interval month, week -> day
Previous:From: Michael GlaesemannDate: 2006-08-31 23:56:28
Subject: Re: [HACKERS] Interval aggregate regression failure

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group