From: Mike Bayer Date: Fri, 15 Dec 2006 16:06:14 +0000 (+0000) Subject: - added "BIGSERIAL" support for postgres table with PGBigInteger/autoincrement X-Git-Tag: rel_0_3_4~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d8b9ca8cb79fa5bc926bfae40284a7b102c4a37;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - added "BIGSERIAL" support for postgres table with PGBigInteger/autoincrement --- diff --git a/CHANGES b/CHANGES index fc6ea080e6..7b44e4c85c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +- added "BIGSERIAL" support for postgres table with PGBigInteger/autoincrement + 0.3.3 - string-based FROM clauses fixed, i.e. select(..., from_obj=["sometext"]) - fixes to passive_deletes flag, lazy=None (noload) flag diff --git a/lib/sqlalchemy/databases/postgres.py b/lib/sqlalchemy/databases/postgres.py index bb950a90cd..9c54901aaa 100644 --- a/lib/sqlalchemy/databases/postgres.py +++ b/lib/sqlalchemy/databases/postgres.py @@ -500,7 +500,10 @@ class PGSchemaGenerator(ansisql.ANSISchemaGenerator): def get_column_specification(self, column, **kwargs): colspec = self.preparer.format_column(column) if column.primary_key and len(column.foreign_keys)==0 and column.autoincrement 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" + if isinstance(column.type, PGBigInteger): + colspec += " BIGSERIAL" + else: + colspec += " SERIAL" else: colspec += " " + column.type.engine_impl(self.engine).get_col_spec() default = self.get_column_default_string(column)