]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- Fixed support for precision numerics when using
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 14 Apr 2011 17:54:47 +0000 (13:54 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 14 Apr 2011 17:54:47 +0000 (13:54 -0400)
pg8000. [ticket:2132]

CHANGES
lib/sqlalchemy/dialects/postgresql/pg8000.py
test/sql/test_types.py

diff --git a/CHANGES b/CHANGES
index b1810f87421eb65abecf0ffeef019ec8d339c9cc..5d4d7cd8715d73b0468e94f151b4250ea8ab1bd1 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -139,6 +139,9 @@ CHANGES
 - 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
index 44e095cdd9c70989682138ddffa64cab45a58bd5..ac927edbb62e3e30413089118dab2024f9e2dc67 100644 (file)
@@ -56,6 +56,11 @@ class _PGNumeric(sqltypes.Numeric):
                 raise exc.InvalidRequestError(
                             "Unknown PG numeric type: %d" % coltype)
 
+
+class _PGNumericNoBind(_PGNumeric):
+    def bind_processor(self, dialect):
+        return None
+
 class PGExecutionContext_pg8000(PGExecutionContext):
     pass
 
@@ -94,7 +99,8 @@ class PGDialect_pg8000(PGDialect):
     colspecs = util.update_copy(
         PGDialect.colspecs,
         {
-            sqltypes.Numeric : _PGNumeric,
+            sqltypes.Numeric : _PGNumericNoBind,
+            sqltypes.Float : _PGNumeric
         }
     )
 
index d44487d536dcf085a4a197720ce30ff2250a8aad..8a8ae9cae574a0f4157ac19831adc85ab8a174a1 100644 (file)
@@ -1435,7 +1435,6 @@ class NumericTest(fixtures.TestBase):
         )
 
     @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')