Contact: fumanchu@aminus.org

Log in as guest/geniusql to create tickets

Ticket #32: geniusql-numeric.patch

  • providers/postgres.py

    old new  
    888889            if dbtypetype in (FLOAT4, FLOAT8): 
    889890                dbtype.precision = int(row[3]) 
    890891            elif dbtypetype in (MONEY, DECIMAL): 
    891                 dbtype.precision = int((row[4] >> 16) & 65535) 
    892                 dbtype.scale = int((row[4] & 65535) - 4) 
     892                if row[4] > 0: 
     893                    dbtype.precision = int((row[4] >> 16) & 65535) 
     894                    dbtype.scale = int((row[4] & 65535) - 4) 
    893895             
    894896            if dbtypetype is VARCHAR: 
    895897                # See http://archives.postgresql.org/pgsql-interfaces/2004-07/msg00021.php