Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #12766 -- Only set the psycopg1 client encoding when the connec…

…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...
commit 59a7ca9f18bd9d31d1b784a1de2fa3a86de0db70 1 parent ef8d351
Russell Keith-Magee authored March 25, 2010

Showing 1 changed file with 2 additions and 3 deletions. Show diff stats Hide diff stats

  1. 5  django/db/backends/postgresql/base.py
5  django/db/backends/postgresql/base.py
@@ -146,9 +146,8 @@ def _cursor(self):
146 146
             if self._version[0:2] < (8, 0):
147 147
                 # No savepoint support for earlier version of PostgreSQL.
148 148
                 self.features.uses_savepoints = False
149  
-        cursor.execute("SET client_encoding to 'UNICODE'")
150  
-        cursor = UnicodeCursorWrapper(cursor, 'utf-8')
151  
-        return cursor
  149
+            cursor.execute("SET client_encoding to 'UNICODE'")
  150
+        return UnicodeCursorWrapper(cursor, 'utf-8')
152 151
 
153 152
 def typecast_string(s):
154 153
     """

0 notes on commit 59a7ca9

Please sign in to comment.
Something went wrong with that request. Please try again.