Re: Range types - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: Range types
Date
Msg-id 1260925533.13414.2262.camel@monkey-cat.sm.truviso.com
Whole thread Raw
In response to Re: Range types  (Christophe Pettus <xof@thebuild.com>)
List pgsql-hackers
On Tue, 2009-12-15 at 16:08 -0800, Christophe Pettus wrote:
> The argument is, in essence:
> 
>     DECIMAL is continuous.
>     DECIMAL(10,3) is discrete.
> 
> timestamptz in general is a continuous value (unless we're talking  
> Planck times :) ).  There is no way for us to guarantee that  
> next(timestamptz) will have the same value across all platforms; its  
> epsilon is platform dependent.

Not unless you compile with float timestamps. Integer timestamps are
microseconds since the year 2000 (positive or negative), which is
platform-independent.

I'm not arguing that we shouldn't support continuous time at all
(clearly, enough people in this thread seem to like it), but I do want
discrete time ranges. A lot of the temporal database literature is
written assuming discrete time intervals.

> But in the current implementation, the only way I can see making that  
> work is if we specify a scale for timestamptz, and that strikes me as  
> a big change to its semantics.

It's already useful at the microsecond precision level. Also, the
granule could be defined for the range type (as Scott suggested) rather
than the timestamp itself.

Regards,Jeff Davis



pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Range types
Next
From: "Florian G. Pflug"
Date:
Subject: Re: Compiling HEAD with -Werror int 64-bit mode