summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/postgresql/psycopg2.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-11-23 17:19:43 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2013-11-23 17:19:43 -0500
commit4acfce6c4c1da91901921ddfae7a682771817945 (patch)
treee690ac0c728b15d79709a13c5601d4ed9dd0466f /lib/sqlalchemy/dialects/postgresql/psycopg2.py
parent50634fcb2d29d3af17cb5b6cb0d12fdf8edaa98e (diff)
downloadsqlalchemy-4acfce6c4c1da91901921ddfae7a682771817945.tar.gz
- evaulate decimal_return_scale statelessly. Don't re-assign to self.decimal_return_scale
so that __repr__() is maintained (for alembic tests)
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/psycopg2.py')
-rw-r--r--lib/sqlalchemy/dialects/postgresql/psycopg2.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/psycopg2.py b/lib/sqlalchemy/dialects/postgresql/psycopg2.py
index 9995a1f5a..d7ce6eb90 100644
--- a/lib/sqlalchemy/dialects/postgresql/psycopg2.py
+++ b/lib/sqlalchemy/dialects/postgresql/psycopg2.py
@@ -192,7 +192,8 @@ class _PGNumeric(sqltypes.Numeric):
if self.asdecimal:
if coltype in _FLOAT_TYPES:
return processors.to_decimal_processor_factory(
- decimal.Decimal, self.decimal_return_scale)
+ decimal.Decimal,
+ self._effective_decimal_return_scale)
elif coltype in _DECIMAL_TYPES or coltype in _INT_TYPES:
# pg8000 returns Decimal natively for 1700
return None