Re: Why is NULL = unbounded for rangetypes?

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Andreas Joseph Krogh <andreak(at)officenet(dot)no>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Why is NULL = unbounded for rangetypes?
Date: 2013-08-30 01:23:09
Message-ID: 1377825789.18255.2.camel@sussancws0025
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 2013-07-09 at 10:45 +0200, Andreas Joseph Krogh wrote:
> I would expect the queries above to return FALSE and have to use
> INFINITY to have them return TRUE. I don't understand what you mean by
> ranges not allowing either bound to be NULL as it seems to be the case
> (as in "it works").

Although passing NULL to the constructor works, it does *not* create a
range where one bound is NULL. It actually creates an unbounded range;
that is, a range where one bound is infinite.

NULL semantics are far too confusing to be useful with ranges. For
instance, if ranges did support NULLs; the queries you mention would
have to return NULL, not FALSE.

Regards,
Jeff Davis

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Kretschmer 2013-08-30 07:43:53 Re: question about age()
Previous Message vibhuti nataraj 2013-08-29 21:59:23 Unable to CREATE SCHEMA and INSERT data in table in that schema in same EXECUTE