Re: Procedure for feature requests?

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Procedure for feature requests?
Date: 2009-10-14 10:28:23
Message-ID: 20091014102823.GQ5407@samason.me.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Oct 13, 2009 at 10:22:04PM +0000, Tim Landscheidt wrote:
> Sam Mason <sam(at)samason(dot)me(dot)uk> wrote:
> > Calculating "(C - B) / C" isn't easy for timestamps, whereas it's easy
> > for dates. I believe this is why there's a specific version for the
> > former but not the latter.
>
> (I obviously meant "(B - A) / C" :-).)

Huh, I hadn't even noticed that!

> I would assume
> that you just have to convert A, B and C to seconds (since
> epoch) and then use a normal integer division.

The problem is that the Gregorian calender is far too complicated. For
example, think what would happen with an interval of "months". It
doesn't help converting to seconds because the length of a month in
seconds changes depending on which year the month is in and which
month you're actually dealing with. This makes any definition of
"division" I've ever been able to think of ill defined and hence the
above calculation won't work.

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2009-10-14 11:11:23 Re: Cannot start the postgres service
Previous Message Pavel Stehule 2009-10-14 09:20:28 Re: Case statement with different data types