summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql/base.py
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2010-03-25 14:03:35 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2010-03-25 14:03:35 +0000
commit59a7ca9f18bd9d31d1b784a1de2fa3a86de0db70 (patch)
tree5d7b47f7506a32bf7abce39a70fd7b667b86b341 /django/db/backends/postgresql/base.py
parentef8d351cdfdbfe6dfd6763d52529e91201699006 (diff)
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
Diffstat (limited to 'django/db/backends/postgresql/base.py')
-rw-r--r--django/db/backends/postgresql/base.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/django/db/backends/postgresql/base.py b/django/db/backends/postgresql/base.py
index ef39fa9867..a1c858bd8f 100644
--- a/django/db/backends/postgresql/base.py
+++ b/django/db/backends/postgresql/base.py
@@ -146,9 +146,8 @@ class DatabaseWrapper(BaseDatabaseWrapper):
if self._version[0:2] < (8, 0):
# No savepoint support for earlier version of PostgreSQL.
self.features.uses_savepoints = False
- cursor.execute("SET client_encoding to 'UNICODE'")
- cursor = UnicodeCursorWrapper(cursor, 'utf-8')
- return cursor
+ cursor.execute("SET client_encoding to 'UNICODE'")
+ return UnicodeCursorWrapper(cursor, 'utf-8')
def typecast_string(s):
"""