1
0
mirror of https://github.com/django/django.git synced 2024-12-25 02:26:12 +00:00

Fixed #12766 -- Only set the psycopg1 client encoding when the connection is first created. This allows the custom_pk test to pass under psycopg1.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12848 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee 2010-03-25 14:03:35 +00:00
parent ef8d351cdf
commit 59a7ca9f18

View File

@ -146,9 +146,8 @@ class DatabaseWrapper(BaseDatabaseWrapper):
if self._version[0:2] < (8, 0): if self._version[0:2] < (8, 0):
# No savepoint support for earlier version of PostgreSQL. # No savepoint support for earlier version of PostgreSQL.
self.features.uses_savepoints = False self.features.uses_savepoints = False
cursor.execute("SET client_encoding to 'UNICODE'") cursor.execute("SET client_encoding to 'UNICODE'")
cursor = UnicodeCursorWrapper(cursor, 'utf-8') return UnicodeCursorWrapper(cursor, 'utf-8')
return cursor
def typecast_string(s): def typecast_string(s):
""" """