diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2023-01-17 09:44:05 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2023-01-17 09:47:08 -0500 |
commit | f91a25cd8191f026dd43c0a2475cda8a56d65c19 (patch) | |
tree | d28d6fa2b4932e39ef40a07d6f7674bec454a72f /lib/sqlalchemy/dialects/postgresql/psycopg.py | |
parent | 030b757d1e1efdc56c42e40ce07ee34a3d00f73a (diff) | |
download | sqlalchemy-f91a25cd8191f026dd43c0a2475cda8a56d65c19.tar.gz |
pass driver_connection to TypeInfo.fetch()
Fixed regression where psycopg3 changed an API call as of version 3.1.8 to
expect a specific object type that was previously not enforced, breaking
connectivity for the psycopg3 dialect.
Fixes: #9106
Change-Id: Ibb42f84b1086f30173aeb6e1f3256c56d129fe6e
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/psycopg.py')
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/psycopg.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/psycopg.py b/lib/sqlalchemy/dialects/postgresql/psycopg.py index ead157b71..3f11556cf 100644 --- a/lib/sqlalchemy/dialects/postgresql/psycopg.py +++ b/lib/sqlalchemy/dialects/postgresql/psycopg.py @@ -339,7 +339,7 @@ class PGDialect_psycopg(_PGDialect_common_psycopg): def _type_info_fetch(self, connection, name): from psycopg.types import TypeInfo - return TypeInfo.fetch(connection.connection, name) + return TypeInfo.fetch(connection.connection.driver_connection, name) def initialize(self, connection): super().initialize(connection) @@ -717,7 +717,7 @@ class PGDialectAsync_psycopg(PGDialect_psycopg): from psycopg.types import TypeInfo adapted = connection.connection - return adapted.await_(TypeInfo.fetch(adapted._connection, name)) + return adapted.await_(TypeInfo.fetch(adapted.driver_connection, name)) def _do_isolation_level(self, connection, autocommit, isolation_level): connection.set_autocommit(autocommit) |