summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/postgresql/pg8000.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-04-07 16:07:55 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2010-04-07 16:07:55 -0400
commit3351b65df94324b2baba87da303c9db3454653d6 (patch)
treeea5e43a5f6360db8a696379e3bced3fc7208fe58 /lib/sqlalchemy/dialects/postgresql/pg8000.py
parent8842bbd8b5e72796926b6e35f86d060c3b86b6a2 (diff)
downloadsqlalchemy-3351b65df94324b2baba87da303c9db3454653d6.tar.gz
- Repaired missing import in psycopg2._PGNumeric type when
unknown numeric is received. - psycopg2/pg8000 dialects now aware of REAL[], FLOAT[], DOUBLE_PRECISION[], NUMERIC[] return types without raising an exception. - introducing testing.provide_metadata for all these stupid little create/drop tests
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/pg8000.py')
-rw-r--r--lib/sqlalchemy/dialects/postgresql/pg8000.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/pg8000.py b/lib/sqlalchemy/dialects/postgresql/pg8000.py
index a620daac6..c822e37a5 100644
--- a/lib/sqlalchemy/dialects/postgresql/pg8000.py
+++ b/lib/sqlalchemy/dialects/postgresql/pg8000.py
@@ -31,18 +31,18 @@ from sqlalchemy.dialects.postgresql.base import PGDialect, \
class _PGNumeric(sqltypes.Numeric):
def result_processor(self, dialect, coltype):
if self.asdecimal:
- if coltype in (700, 701):
+ if coltype in (700, 701, 1021, 1022):
return processors.to_decimal_processor_factory(decimal.Decimal)
- elif coltype == 1700:
+ elif coltype in (1700, 1231):
# pg8000 returns Decimal natively for 1700
return None
else:
raise exc.InvalidRequestError("Unknown PG numeric type: %d" % coltype)
else:
- if coltype in (700, 701):
+ if coltype in (700, 701, 1021, 1022):
# pg8000 returns float natively for 701
return None
- elif coltype == 1700:
+ elif coltype in (1700, 1231):
return processors.to_float
else:
raise exc.InvalidRequestError("Unknown PG numeric type: %d" % coltype)