summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/postgresql/base.py
diff options
context:
space:
mode:
authorJ. Nick Koston <nick@koston.org>2023-04-24 22:32:17 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2023-04-25 10:20:36 -0400
commit188cb4226ac7b337446689ab3498b4397d0b7d2d (patch)
treebdd19819afc3daf710db47f536c1e2f3d6d9e855 /lib/sqlalchemy/dialects/postgresql/base.py
parent32a17e60ba63f0278a754e1ab7e9ebf9460e07c5 (diff)
downloadsqlalchemy-188cb4226ac7b337446689ab3498b4397d0b7d2d.tar.gz
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
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/base.py')
-rw-r--r--lib/sqlalchemy/dialects/postgresql/base.py2
1 files changed, 2 insertions, 0 deletions
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