]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Correct for Variant + ARRAY cases in psycopg2
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 1 Apr 2021 16:26:06 +0000 (12:26 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 1 Apr 2021 17:23:50 +0000 (13:23 -0400)
commita241f8c7539720ebcfe0ae240b593036e5ff9b65
tree257d3af983f29c67cbcaf05038956f7964432dca
parent2c18de6817b2ee91fa0205d9c033c4e36e0ad7da
Correct for Variant + ARRAY cases in psycopg2

Fixed regression caused by :ticket:`6023` where the PostgreSQL cast
operator applied to elements within an :class:`_types.ARRAY` when using
psycopg2 would fail to use the correct type in the case that the datatype
were also embedded within an instance of the :class:`_types.Variant`
adapter.

Additionally, repairs support for the correct CREATE TYPE to be emitted
when using a ``Variant(ARRAY(some_schema_type))``.

Fixes: #6182
Change-Id: I1b9ba7c876980d4650715a0b0801b46bdc72860d
(cherry picked from commit 43e98c75bde96ef27daeaf7fbfbea30b7eb7c295)
doc/build/changelog/unreleased_13/6182.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/postgresql/base.py
lib/sqlalchemy/dialects/postgresql/psycopg2.py
lib/sqlalchemy/sql/sqltypes.py
lib/sqlalchemy/sql/type_api.py
test/dialect/postgresql/test_types.py
test/sql/test_metadata.py