Re: Range Types: empty ranges

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Range Types: empty ranges
Date: 2011-02-11 18:50:55
Message-ID: AANLkTinLOEHbTSyZirzmaSoV40ODs=AKP-tzTBmXw6VJ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Feb 11, 2011 at 1:11 PM, Jeff Davis <pgsql(at)j-davis(dot)com> wrote:
> Similarly, "intersection" of ranges is somewhat analogous to
> multiplication of numbers.

I had a feeling that we might be going in this direction. It strikes
me that this case is a bit like division by zero. It's kind of a
nuisance that dividing by zero throws an error and we COULD fix that
by making it return NULL or NaN or some new distinguished value DbZ.
But then we'd have to define what happens when you feed DbZ into every
other operation in the system, and similarly here. If we define two
non-overlapping ranges as intersecting to NULL, or as throwing an
error, then everything else is clear after that. I'm not sure it's
worth complicating the representation and the definitions of other
operations to cater to this case.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-02-11 18:55:45 Re: ALTER TYPE 2: skip already-provable no-work rewrites
Previous Message Kevin Grittner 2011-02-11 18:50:50 Re: Range Types: empty ranges