Navigation Menu

Skip to content

Commit

Permalink
Fixed #12766 -- Only set the psycopg1 client encoding when the connec…
Browse files Browse the repository at this point in the history
…tion 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
  • Loading branch information
freakboy3742 committed Mar 25, 2010
1 parent ef8d351 commit 59a7ca9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions django/db/backends/postgresql/base.py
Expand Up @@ -146,9 +146,8 @@ def _cursor(self):
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):
""" """
Expand Down

0 comments on commit 59a7ca9

Please sign in to comment.