From: Billy G. A. <bal...@us...> - 2001-11-03 18:36:54
|
Update of /cvsroot/pypgsql/pypgsql/pyPgSQL In directory usw-pr-cvs1:/tmp/cvs-serv16123/pyPgSQL Modified Files: PgSQL.py Log Message: 03NOV2001 bga It appears that under certain circumstances, PostgreSQL will not return a precision/scale value for a numeric column when no result rows are returned [Bug #477792]. The problem is fixed by using a precision of (30,6) in case this condition occurs. Index: PgSQL.py =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/pyPgSQL/PgSQL.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PgSQL.py 2001/10/20 23:38:04 1.3 --- PgSQL.py 2001/11/03 18:36:50 1.4 *************** *** 30,33 **** --- 30,38 ---- # Date Ini Description | # --------- --- ------------------------------------------------------- | + # 03NOV2001 bga It appears that under certain circumstances, PostgreSQL | + # will not return a precision/scale value for a numeric | + # column when no result rows are returned [Bug #477792]. | + # The problem is fixed by using a precision of (30,6) in | + # case this condition occurs. | # 21OCT2001 gh Change the import of DateTime to avoid conflicts with | # ZOPE's builtin DateTime module. | *************** *** 1907,1914 **** # We have a numeric with no scale/precision. # Get them from by converting the string to a PgNumeric ! # and pulling them form the PgNumeric object. ! nv = PgNumeric(_res.getvalue(0, _i)) ! _p = nv.getPrecision() ! _s = nv.getScale() else: # We hava a valid scale/precision value. Use them. --- 1912,1924 ---- # We have a numeric with no scale/precision. # Get them from by converting the string to a PgNumeric ! # and pulling them form the PgNumeric object. If that ! # fails default to a precision of 30 with a scale of 6. ! try: ! nv = PgNumeric(_res.getvalue(0, _i)) ! _p = nv.getPrecision() ! _s = nv.getScale() ! except ValueError, m: ! _p = 30 ! _s = 6 else: # We hava a valid scale/precision value. Use them. |