]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Don't set pg autoincrement if type affinity is not Integer
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 20 Oct 2016 21:36:59 +0000 (17:36 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 20 Oct 2016 21:38:22 +0000 (17:38 -0400)
commit232eec47d13974e9c7bc7bafacba93ddbd59747d
treebe24dca93d7ea036208a55663b90174de106c181
parent78f2864b90c9df03aaa2fdddb9fd7d394abdbc31
Don't set pg autoincrement if type affinity is not Integer

Postgresql table reflection will ensure that the
:paramref:`.Column.autoincrement` flag is set to False when reflecting
a primary key column that is not of an :class:`.Integer` datatype,
even if the default is related to an integer-generating sequence.
This can happen if a column is created as SERIAL and the datatype
is changed.  The autoincrement flag can only be True if the datatype
is of integer affinity in the 1.1 series.

This bug is related to a test failure in downstream sqlalchemy_migrate.

Change-Id: I40260e47e1927a1ac940538408983c943bbdba28
Fixes: #3835
doc/build/changelog/changelog_11.rst
lib/sqlalchemy/dialects/postgresql/base.py
test/dialect/postgresql/test_reflection.py