Commits

Mike Bayer  committed 4efe203

- Fixed support for precision numerics when using
pg8000. [ticket:2132]

  • Participants
  • Parent commits 8878292

Comments (0)

Files changed (3)

 - postgresql
   - Psycopg2 for Python 3 is now supported.
 
+  - Fixed support for precision numerics when using
+    pg8000. [ticket:2132]
+
 - oracle
   - Using column names that would require quotes
     for the column itself or for a name-generated

File lib/sqlalchemy/dialects/postgresql/pg8000.py

                 raise exc.InvalidRequestError(
                             "Unknown PG numeric type: %d" % coltype)
 
+
+class _PGNumericNoBind(_PGNumeric):
+    def bind_processor(self, dialect):
+        return None
+
 class PGExecutionContext_pg8000(PGExecutionContext):
     pass
 
     colspecs = util.update_copy(
         PGDialect.colspecs,
         {
-            sqltypes.Numeric : _PGNumeric,
+            sqltypes.Numeric : _PGNumericNoBind,
+            sqltypes.Float : _PGNumeric
         }
     )
 

File test/sql/test_types.py

         )
 
     @testing.fails_on('sqlite', 'TODO')
-    @testing.fails_on('postgresql+pg8000', 'TODO')
     @testing.fails_on("firebird", "Precision must be from 1 to 18")
     @testing.fails_on("sybase+pysybase", "TODO")
     @testing.fails_on('mssql+pymssql', 'FIXME: improve pymssql dec handling')