Re: Statistical Lacunae in Interval type

From: David Fetter <david(at)fetter(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Statistical Lacunae in Interval type
Date: 2004-07-12 15:44:55
Message-ID: 20040712154455.GE23679@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jul 12, 2004 at 11:10:34AM -0400, Tom Lane wrote:
> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> > The problem is that an interval datum already implies the units,
> > so in order to allow interval * interval we would have to add a
> > new type "interval squared", which would probably be considered to
> > be a bit foolish.
>
> Not only foolish but complicated. Remember that interval internally
> is "N months plus X seconds" (where N is integral but X needn't be).
> To avoid losing information, a product datatype would have to look
> something like "N months-squared plus X months-seconds plus Y
> seconds-squared", which offers no intuition whatever about how to
> operate on it. I doubt there's even a unique way to define
> square-rooting this.

That's kinda what I was afraid of. If an interval were defined
internally as a unique number of seconds, it would be easy.

> Add on top the fact that we really need to change interval to be "M
> months plus N days plus X seconds" to solve the ever-popular
> daylight-savings-transition issues, and a product datatype would get
> out of hand altogether.

Yeah.

> When I said "mash it down to seconds first", I was speaking very
> literally...

OK. So it looks like (oddly) interval can have a std. deviation,
which is measured in seconds, but not a variance. Is that pretty
close?

Cheers,
D
--
David Fetter david(at)fetter(dot)org http://fetter.org/
phone: +1 510 893 6100 mobile: +1 415 235 3778

Remember to vote!

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-07-12 17:49:41 Beta date
Previous Message Tom Lane 2004-07-12 15:10:34 Re: Statistical Lacunae in Interval type