Re: Range types

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Christophe Pettus <xof(at)thebuild(dot)com>
Cc: hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Range types
Date: 2009-12-16 01:05:33
Message-ID: 1260925533.13414.2262.camel@monkey-cat.sm.truviso.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Florian G. Pflug 2009-12-16 01:56:05 Re: Compiling HEAD with -Werror int 64-bit mode
Previous Message Jeff Davis 2009-12-16 00:58:14 Re: Range types