summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-09-19 01:37:14 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-09-19 01:37:14 +0000
commit5c1e1c28dafa47671ffe9961a952a36f688964ab (patch)
treed8ba7e02b9e18acd6d20d0f406b4c29ffc76c164 /lib
parent0ecde01dd0ee158739be2031fc839d0db87f65e1 (diff)
downloadsqlalchemy-5c1e1c28dafa47671ffe9961a952a36f688964ab.tar.gz
no SERIAL for smallinteger columns
Diffstat (limited to 'lib')
-rw-r--r--lib/sqlalchemy/databases/postgres.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/databases/postgres.py b/lib/sqlalchemy/databases/postgres.py
index 8234d96f0..7bf786976 100644
--- a/lib/sqlalchemy/databases/postgres.py
+++ b/lib/sqlalchemy/databases/postgres.py
@@ -490,7 +490,7 @@ class PGSchemaGenerator(ansisql.ANSISchemaGenerator):
def get_column_specification(self, column, **kwargs):
colspec = self.preparer.format_column(column)
- if column.primary_key and not column.foreign_key and isinstance(column.type, sqltypes.Integer) and (column.default is None or (isinstance(column.default, schema.Sequence) and column.default.optional)):
+ if column.primary_key and not column.foreign_key and isinstance(column.type, sqltypes.Integer) and not isinstance(column.type, sqltypes.SmallInteger) and (column.default is None or (isinstance(column.default, schema.Sequence) and column.default.optional)):
colspec += " SERIAL"
else:
colspec += " " + column.type.engine_impl(self.engine).get_col_spec()