Why is NULL = unbounded for rangetypes? - Mailing list pgsql-general

From Andreas Joseph Krogh
Subject Why is NULL = unbounded for rangetypes?
Date
Msg-id OrigoEmail.b39.9039764ca71b5d10.13fbd566210@prod2
Whole thread Raw
Responses Re: Why is NULL = unbounded for rangetypes?
List pgsql-general
<div>Hi.</div><div> </div><div>Both of these queries return TRUE because NULL means "unmounded":</div><div><style
type="text/css"></style><preclass="western" style="text-align: left"> 
<font face="DejaVu Sans Mono"><font color="#000080"><b>select daterange</b></font><font color="#000000">(</font><font
color="#008000"><b>'2013-07-01'</b></font><font color="#000000">:: </font><font color="#000080"><b>DATE</b></font><font
color="#000000">,</font><font color="#000080"><b>null</b></font><font color="#000000">, </font><font
color="#008000"><b>'[]'</b></font><fontcolor="#000000">) && </font><font
color="#000080"><b>daterange</b></font><fontcolor="#000000">(</font><font color="#008000"><b>'2013-07-04'
</b></font><fontcolor="#000000">:: </font><font color="#000080"><b>DATE</b></font><font color="#000000">, </font><font
color="#008000"><b>'2013-07-30'</b></font><font color="#000000">:: </font><font color="#000080"><b>DATE</b></font><font
color="#000000">,</font><font color="#008000"><b>'[]'</b></font><font color="#000000">);</font></font> 
<font face="DejaVu Sans Mono"><font color="#000080"><b>select daterange</b></font><font color="#000000">(</font><font
color="#000080"><b>null</b></font><fontcolor="#000000">, </font><font color="#008000"><b>'2013-08-11' </b></font><font
color="#000000">::</font><font color="#000080"><b>DATE</b></font><font color="#000000">, </font><font
color="#008000"><b>'[]'</b></font><fontcolor="#000000">) && </font><font
color="#000080"><b>daterange</b></font><fontcolor="#000000">(</font><font color="#008000"><b>'2013-07-04'
</b></font><fontcolor="#000000">:: </font><font color="#000080"><b>DATE</b></font><font color="#000000">, </font><font
color="#008000"><b>'2013-07-30'</b></font><font color="#000000">:: </font><font color="#000080"><b>DATE</b></font><font
color="#000000">,</font><font color="#008000"><b>'[]'</b></font><font color="#000000">);</font></font></pre><div>What
isthe rational behind this behavior of NULL?</div></div><div>  <div class="origo-email-signature">--<br /> Andreas
JosephKrogh <andreak@officenet.no>      mob: +47 909 56 963<br /> Senior Software Developer / CTO - OfficeNet AS
-http://www.officenet.no<br /> Public key: http://home.officenet.no/~andreak/public_key.asc</div></div> 

pgsql-general by date:

Previous
From: Kevin Grittner
Date:
Subject: Re: Efficiency of materialized views refresh in 9.3
Next
From: Jov
Date:
Subject: backend hangs at sendto() and can't be terminated