diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-07-11 19:23:40 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-07-11 19:23:40 -0400 |
commit | 520b808db255eba3fdccfb93656a79008154dcae (patch) | |
tree | 428dfd4a203a7b161b8a063f69086d7aed6e0608 /lib/sqlalchemy/dialects/postgresql/base.py | |
parent | ca52e87268fec966f6005b1e4aa30206ae895e9e (diff) | |
download | sqlalchemy-520b808db255eba3fdccfb93656a79008154dcae.tar.gz |
repair schema_translate_map for schema type use cases
Fixed issue where the PostgreSQL ``ENUM`` datatype as embedded in the
``ARRAY`` datatype would fail to emit correctly in create/drop when the
``schema_translate_map`` feature were also in use. Additionally repairs a
related issue where the same ``schema_translate_map`` feature would not
work for the ``ENUM`` datatype in combination with a ``CAST``, that's also
intrinsic to how the ``ARRAY(ENUM)`` combination works on the PostgreSQL
dialect.
Fixes: #6739
Change-Id: I44b1ad4db4af3acbf639aa422c46c22dd3b0d3a6
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/base.py')
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/base.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index ea2eda902..123e6f0fa 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -2820,7 +2820,6 @@ class PGTypeCompiler(compiler.GenericTypeCompiler): def visit_ENUM(self, type_, identifier_preparer=None, **kw): if identifier_preparer is None: identifier_preparer = self.dialect.identifier_preparer - return identifier_preparer.format_type(type_) def visit_TIMESTAMP(self, type_, **kw): @@ -2867,8 +2866,7 @@ class PGTypeCompiler(compiler.GenericTypeCompiler): def visit_ARRAY(self, type_, **kw): - # TODO: pass **kw? - inner = self.process(type_.item_type) + inner = self.process(type_.item_type, **kw) return re.sub( r"((?: COLLATE.*)?)$", ( |