Update of /cvsroot/pypgsql/pypgsql/pyPgSQL
In directory sc8-pr-cvs1:/tmp/cvs-serv8209/pyPgSQL
Modified Files:
PgSQL.py
Log Message:
12JAN2003 bga - Change the code so that the display length in the
cursor.description attribute is always None instead of '-1'.
- Fixed another problem with interval <-> DateTimeDelta casting.
Index: PgSQL.py
===================================================================
RCS file: /cvsroot/pypgsql/pypgsql/pyPgSQL/PgSQL.py,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** PgSQL.py 23 Dec 2002 05:45:43 -0000 1.30
--- PgSQL.py 12 Jan 2003 10:03:04 -0000 1.31
***************
*** 30,33 ****
--- 30,38 ----
# Date Ini Description |
# --------- --- ------------------------------------------------------- |
+ # 12JAN2003 bga - Change the code so that the display length in the |
+ # cursor.description attribute is always None instead |
+ # of '-1'. |
+ # - Fixed another problem with interval <-> DateTimeDelta |
+ # casting. |
# 23DEC2002 bga - Corrected a problem that caused the close of a portal |
# (ie. PostgreSQL cursor) to fail. |
***************
*** 534,548 ****
# Convert any years using 365.2425 days per year, which is PostgreSQL's
# 's assumption about the number of days in a year.
! if ydh[1].lower().startswith('year'):
! result += parser('%s days' % ((int(ydh[0]) * 365.2425),))
! ydh = ydh[2:]
# Converts any days and adds it to the years (as an interval)
! if ydh[1].lower().startswith('day'):
! result += parser('%s days' % (ydh[0],))
! ydh = ydh[2:]
# Adds in the hours, minutes, seconds (as an interval)
! result += parser(ydh[0])
return result
--- 539,556 ----
# Convert any years using 365.2425 days per year, which is PostgreSQL's
# 's assumption about the number of days in a year.
! if len(ydh) > 1:
! if ydh[1].lower().startswith('year'):
! result += parser('%s days' % ((int(ydh[0]) * 365.2425),))
! ydh = ydh[2:]
# Converts any days and adds it to the years (as an interval)
! if len(ydh) > 1:
! if ydh[1].lower().startswith('day'):
! result += parser('%s days' % (ydh[0],))
! ydh = ydh[2:]
# Adds in the hours, minutes, seconds (as an interval)
! if len(ydh) > 0:
! result += parser(ydh[0])
return result
***************
*** 2802,2806 ****
_p = (_s >> 16) & 0xffff
_s = _s & 0xffff
! _j.append(_p + 3) # Display size
_j.append(_p) # Internal (storage) size
_j.append(_p) # Precision
--- 2810,2814 ----
_p = (_s >> 16) & 0xffff
_s = _s & 0xffff
! _j.append(None) # Display size (always None since PG7.3)
_j.append(_p) # Internal (storage) size
_j.append(_p) # Precision
***************
*** 2811,2815 ****
if _pl == -1:
_pl = _mod - self._varhdrsz
! _j.append(_pl) # Display size
_s = _res.fsize(_i)
if _s == -1:
--- 2819,2823 ----
if _pl == -1:
_pl = _mod - self._varhdrsz
! _j.append(None) # Display size (always None since PG7.3)
_s = _res.fsize(_i)
if _s == -1:
***************
*** 2817,2821 ****
_j.append(_s) # Internal (storage) size
if _typ.value == PG_MONEY:
! _j.append(9) # Presicion and Scale (from
_j.append(2) # the PostgreSQL doco.)
else:
--- 2825,2829 ----
_j.append(_s) # Internal (storage) size
if _typ.value == PG_MONEY:
! _j.append(9) # Presicion and Scale (from
_j.append(2) # the PostgreSQL doco.)
else:
|