]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commit
Change single-quoting of floats in PostgreSQL compare_server_default
authorDimitris Theodorou <dimitris.theodorou@gmail.com>
Sun, 11 Jan 2015 23:41:59 +0000 (00:41 +0100)
committerDimitris Theodorou <dimitris.theodorou@gmail.com>
Sun, 11 Jan 2015 23:41:59 +0000 (00:41 +0100)
commit214228a9dd0fa307fc9d0ebfd6a52390cd63f6f7
tree16d79a9ce78986c6397cebd76749eede59ae4025
parent00dae5f77e51c8cb4902939a5b85efdfb920c68b
Change single-quoting of floats in PostgreSQL compare_server_default

Do not wrap string defaults with single quotes when comparing against
columns of type float or numeric.
This fixes the crash occuring when the default of a float column is
an integer value (e.g., DEFAULT 5), while the Python server_default is
a string (e.g., server_default="5.0"). This results in the query
used in the comparison to throw a DataError ('SELECT 5 = '5.0').
alembic/ddl/postgresql.py
tests/test_postgresql.py