On Fri, 14 Feb 2014, Chris Barker wrote:
This is actually a pretty common case -- the question here is: Is this
really None? or does None have a special meaning. It sounds like this is a
wrapper for a PostgreSQL range object, in which case None isn't really
right, there must be a +-infinity concept there -- how does postgress handle
it? (is this a generic range, or a datetime range? I'm not up on it).
If this means what I think it does, None is really a hack, both because of
al lteh specia case code required for sorting, comparing, etc, but also
because it's missing information -- the two ends of the range should really
have different meanings.
Postgres range types are a separate kind of type which can be created
using CREATE TYPE:
http://www.postgresql.org/docs/current/interactive/sql-createtype.html
Several handy range types are built in, although not as many as one might
expect.
Postgres ranges can be made infinite by specifying NULL as a bound.
There isn't a separate special value for this. This has somewhat strange
effects when the base type of the range has its own "infinity" value:
=> select upper_inf (daterange (current_date, 'infinity'));
upper_inf
-----------
f
(1 row)
=> select isfinite ('infinity'::date);
isfinite
----------
f
(1 row)
=> select upper_inf (daterange (current_date, null));
upper_inf
-----------
t
(1 row)
In other words, a range with non-NULL bounds is finite according to the
range functions even if the bound is the infinity value of the base type.
Isaac Morland CSCF Web Guru
DC 2619, x36650 WWW Software Specialist
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com