diff options
author | J. Nick Koston <nick@koston.org> | 2023-04-24 22:32:17 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2023-04-25 10:20:36 -0400 |
commit | 188cb4226ac7b337446689ab3498b4397d0b7d2d (patch) | |
tree | bdd19819afc3daf710db47f536c1e2f3d6d9e855 /lib/sqlalchemy/dialects/postgresql/psycopg2.py | |
parent | 32a17e60ba63f0278a754e1ab7e9ebf9460e07c5 (diff) | |
download | sqlalchemy-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/psycopg2.py')
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/psycopg2.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/psycopg2.py b/lib/sqlalchemy/dialects/postgresql/psycopg2.py index e28bd8fda..5cdd34183 100644 --- a/lib/sqlalchemy/dialects/postgresql/psycopg2.py +++ b/lib/sqlalchemy/dialects/postgresql/psycopg2.py @@ -600,6 +600,8 @@ class PGDialect_psycopg2(_PGDialect_common_psycopg): psycopg2_version = (0, 0) use_insertmanyvalues_wo_returning = True + returns_native_bytes = False + _has_native_hstore = True colspecs = util.update_copy( |