]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
pass driver_connection to TypeInfo.fetch()
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 17 Jan 2023 14:44:05 +0000 (09:44 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 17 Jan 2023 14:47:08 +0000 (09:47 -0500)
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

doc/build/changelog/unreleased_20/9106.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/postgresql/psycopg.py

diff --git a/doc/build/changelog/unreleased_20/9106.rst b/doc/build/changelog/unreleased_20/9106.rst
new file mode 100644 (file)
index 0000000..02e0495
--- /dev/null
@@ -0,0 +1,7 @@
+.. change::
+    :tags: bug, postgresql
+    :tickets: 9106
+
+    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.
index ead157b71b098a2478b12b489e79ef2d90401ddf..3f11556cf542d1f7fd80b71f7a351afc055aa358 100644 (file)
@@ -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)