From 188cb4226ac7b337446689ab3498b4397d0b7d2d Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 24 Apr 2023 22:32:17 -0400 Subject: disable "bytes" handler for all drivers other than psycopg2 Improved row processing performance for "binary" datatypes by making the "bytes" handler conditional on a per driver basis. As a result, the "bytes" result handler has been disabled for nearly all drivers other than psycopg2, all of which in modern forms support returning Python "bytes" directly. Pull request courtesy J. Nick Koston. Fixes: #9680 Closes: #9681 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/9681 Pull-request-sha: 4f2fd88bd9af54c54438a3b72a2f30384b0f8898 Change-Id: I394bdcbebaab272e63b13cc02f60813b7aa76839 --- lib/sqlalchemy/dialects/postgresql/base.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/sqlalchemy/dialects/postgresql/base.py') diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index ad5e346b7..8e9994293 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -2912,6 +2912,8 @@ class PGDialect(default.DefaultDialect): postfetch_lastrowid = False use_insertmanyvalues = True + returns_native_bytes = True + insertmanyvalues_implicit_sentinel = ( InsertmanyvaluesSentinelOpts.ANY_AUTOINCREMENT | InsertmanyvaluesSentinelOpts.USE_INSERT_FROM_SELECT -- cgit v1.2.1