]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
ignore and warn for native_enum=False with pg.ENUM datatype
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 30 Mar 2021 19:22:01 +0000 (15:22 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 10 Sep 2021 14:41:41 +0000 (10:41 -0400)
commit74f52f86ce45f187055596832a9bdf1aeb47b99c
treecc5605e70439007d4f0c2cd471514c377a64c647
parent4cca61c93d0f35f351cc890fd4d2d6fd6e27d734
ignore and warn for native_enum=False with pg.ENUM datatype

any UPPERCASE datatype refers to that exact type name rendered
on the database.   So PG's ENUM must render "ENUM" and is
"native" by definition.  warn if this flag is passed.

The :class:`_postgresql.ENUM` datatype is PostgreSQL-native and therefore
should not be used with the ``native_enum=False`` flag. This flag is now
ignored if passed to the :class:`_postgresql.ENUM` datatype and a warning
is emitted; previously the flag would cause the type object to fail to
function correctly.

Fixes: #6106
Change-Id: I08e0ec6fcfafd068e1eaf6aec13c8010f09ce94a
doc/build/changelog/unreleased_14/6106.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/postgresql/base.py
test/dialect/postgresql/test_types.py