summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/postgresql/base.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2016-07-04 16:37:26 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2016-07-04 16:54:01 -0400
commit428dfeee48c1fc4ceb5712b8934e90132ee57e33 (patch)
tree3302a446ef026ffa995a471ec2fb8e88a1533198 /lib/sqlalchemy/dialects/postgresql/base.py
parentf5ec60c8811feb92ded85f8a4f8c3071e44acddf (diff)
downloadsqlalchemy-428dfeee48c1fc4ceb5712b8934e90132ee57e33.tar.gz
Repair PG BIGSERIAL w/ TypeDecorator, Variant
Some of the dialect impl memoization for TypeDecorator necessarily keeps the top-level TypeDecorator type around, since a user-defined type will have bind and result set processing behavior. For both TypeDecorator and Variant, PG dialect needs to ensure it's looking at the SQLAlchemy type to check for SmallInteger / BigInteger. Fixes: 3739 Change-Id: I2d45fb997f17c6272d6bb826a77d2dba665adae7 (cherry picked from commit 421fa6b8bf9f0c3c5041579c89ec405ce0f5e0b0)
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/base.py')
-rw-r--r--lib/sqlalchemy/dialects/postgresql/base.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py
index 688ce9e1c..cc0f890dc 100644
--- a/lib/sqlalchemy/dialects/postgresql/base.py
+++ b/lib/sqlalchemy/dialects/postgresql/base.py
@@ -1484,6 +1484,9 @@ class PGDDLCompiler(compiler.DDLCompiler):
colspec = self.preparer.format_column(column)
impl_type = column.type.dialect_impl(self.dialect)
+ if isinstance(impl_type, sqltypes.TypeDecorator):
+ impl_type = impl_type.impl
+
if column.primary_key and \
column is column.table._autoincrement_column and \
(