Search Postgresql Archives

Re: Why is NULL = unbounded for rangetypes?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



På fredag 30. august 2013 kl. 03:23:09, skrev Jeff Davis <pgsql@xxxxxxxxxxx>:
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.
 
But I agree that returning NULL would be OK, then it would be easy to catch in queries when starting playing with range-types in queries. Having it implicitly mean infinity comes as a surprise, to me at least.
 
But now that I know this it's exactly not a blocker...
 
--
Andreas Joseph Krogh <andreak@xxxxxxxxxxxx>      mob: +47 909 56 963
Senior Software Developer / CTO - OfficeNet AS - http://www.officenet.no
Public key: http://home.officenet.no/~andreak/public_key.asc
 

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux