From 893b4964810fdfe0cde58537cc961c24b0c408fc Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 4 Jul 2014 15:49:01 -0400 Subject: [PATCH] - clarify that the pg8000 backend has no impact of any kind on the pg8000 DBAPI's encoding behavior, fixes #3112. --- lib/sqlalchemy/dialects/postgresql/pg8000.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/sqlalchemy/dialects/postgresql/pg8000.py b/lib/sqlalchemy/dialects/postgresql/pg8000.py index 8ed7c9423d..dc5ed6e73f 100644 --- a/lib/sqlalchemy/dialects/postgresql/pg8000.py +++ b/lib/sqlalchemy/dialects/postgresql/pg8000.py @@ -16,14 +16,15 @@ postgresql+pg8000://user:password@host:port/dbname[?key=value&key=value...] Unicode ------- -When communicating with the server, pg8000 uses the character set that the -server asks it to use (the client encoding). By default the client encoding is -the database's character set (chosen when the database is created), but the -client encoding can be changed in a number of ways (eg. setting CLIENT_ENCODING -in postgresql.conf). - -Set the "encoding" parameter on create_engine(), to the same as the client -encoding, usually "utf-8". +When communicating with the server, pg8000 **always uses the server-side +character set**. SQLAlchemy has no ability to modify what character set +pg8000 chooses to use, and additionally SQLAlchemy does no unicode conversion +of any kind with the pg8000 backend. The origin of the client encoding setting +is ultimately the CLIENT_ENCODING setting in postgresql.conf. + +It is not necessary, though is also harmless, to pass the "encoding" parameter +to :func:`.create_engine` when using pg8000. + .. _pg8000_isolation_level: -- 2.47.3