#31 Use December 31, 9999 instead of December 13 for infinite

open
nobody
None
5
2007-12-18
2007-12-18
Vincent Vinet
No

When faced with infinity as a value for datetimes, the current code replaces them with the maximum value for python's datetime type.

I guess a type made it into the code, as the date currently used is December 13, 9999...
a simple
sed -i PgSQL.py -e "s:9999-12-13:9999-12-31:g"
Fixes the two occurences, as shown by a subsequent
diff -u PgSQL.py.bak PgSQL.py
--- PgSQL.py.bak 2007-12-18 11:11:12.000000000 -0500
+++ PgSQL.py 2007-12-18 11:11:36.000000000 -0500
@@ -928,7 +928,7 @@
elif _ftv == DATETIME:
if type(value) is DateTimeType:
if value in ('infinity', '+infinity', '-infinity'):
- fake_infinity = '9999-12-13 23:59:59' # fake infinity
+ fake_infinity = '9999-12-31 23:59:59' # fake infinity
if value[0] == '-':
value = '-' + fake_infinity
else:
@@ -998,7 +998,7 @@
elif _ftv == DATETIME:
if _fvt != PG_INTERVAL:
if lst[_i] in ('infinity', '+infinity', '-infinity'):
- fake_infinity = '9999-12-13 23:59:59' # fake infinity
+ fake_infinity = '9999-12-31 23:59:59' # fake infinity
if lst[_i][0] == '-':
lst[_i] = '-' + fake_infinity
else:

Discussion