Re: Range types - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: Range types
Date
Msg-id 1261002324.13414.2428.camel@monkey-cat.sm.truviso.com
Whole thread Raw
In response to Re: Range types  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, 2009-12-16 at 13:59 -0500, Tom Lane wrote:
> For example, if you're trying to do classroom scheduling, it might be
> useful to constrain the periods to start and end on hour boundaries
> --- but the next thing you'll want is to have it know that the "next"
> slot after 5pm Friday is 8am Monday.  Except on holidays.  And then
> there's the fact that my alma mater starts most hour-long classes on
> the half hour.

Data types are only a first-level constraint -- a domain of reasonable
values. The class isn't going to start on a fraction-of-a-minute
boundary, so it would be reasonable to reject those values early.

I never suggested that next() should be such a highly business-dependent
function as you suggest above (skipping holidays, etc); it should just
return the next value in the domain (if it's discrete).

Surely you wouldn't suggest that the ipv4 data type's next() function
should skip over addresses that aren't in a valid subnet on your
network. But you seem to think those make useful discrete ranges.

Regards,Jeff Davis



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Largeobject Access Controls and pg_migrator
Next
From: Robert Haas
Date:
Subject: Re: Largeobject Access Controls (r2460)