Re: Can't figure out how to use now() in default for tsrange column (PG 9.2)

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Alban Hertroys <haramrae(at)gmail(dot)com>
Cc: Chris Bartlett <c(dot)bartlett(at)paradise(dot)net(dot)nz>, pgsql-general(at)postgresql(dot)org
Subject: Re: Can't figure out how to use now() in default for tsrange column (PG 9.2)
Date: 2012-07-17 00:38:33
Message-ID: 1342485513.9520.17.camel@sussancws0025
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 2012-07-16 at 13:41 +0200, Alban Hertroys wrote:
> >> BTW, that second value looks a whole lot like a poorly thought out
> >> substitute for 'infinity' ...
> >> regards, tom lane
> >
> > That's certainly an interesting comment and I'm open to suggestions! The
> > original db has two columns (from_timestamp, to_timestamp). I don't go for
> > NULL in the to_timestamp column. Alternatively, a timestamp very, very far
> > in the future can throw off query planners.
>
> Tom is telling you that there is a special "timestamp" 'infinity':

Or, perhaps specify NULL for the upper bound, indicating that there is
no upper bound and the range will be infinite.

Note that this does not mean that the upper bound is NULL in the
"unknown" sense, it means that there is no upper bound.

Ranges have their own internal concept of unbounded ranges, so they work
for other data types that don't have a concept of infinity (like
"integer").

Regards,
Jeff Davis

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Chris Travers 2012-07-17 01:14:21 Re: Create stored procedure from C#.net
Previous Message Daniele Varrazzo 2012-07-16 22:41:37 Re: Can't figure out how to use now() in default for tsrange column (PG 9.2)