]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
fix pg ENUM issues
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 8 Apr 2023 22:43:31 +0000 (18:43 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 8 Apr 2023 22:45:31 +0000 (18:45 -0400)
commit8128a8f3638b522778458edb81c81e654927bea4
tree3e5fab30b47e490a1faefc6d06d9611b4e23fb97
parent0cb1e5d08d3ec448c2b318966a675c963cd12aa0
fix pg ENUM issues

Restored the :paramref:`_postgresql.ENUM.name` parameter as optional in the
signature for :class:`_postgresql.ENUM`, as this is chosen automatically
from a given pep-435 ``Enum`` type.

Fixed issue where the comparison for :class:`_postgresql.ENUM` against a
plain string would cast that right-hand side type as VARCHAR, which due to
more explicit casting added to dialects such as asyncpg would produce a
PostgreSQL type mismatch error.

Fixes: #9611
Fixes: #9621
Change-Id: If095544cd1a52016ad2e7cfa2d70c919a94e79c1
doc/build/changelog/unreleased_20/9621.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/postgresql/named_types.py
test/dialect/postgresql/test_types.py