Skip to content

Commit

Permalink
Made psycopg2 backend behave the same as the other backends when it c…
Browse files Browse the repository at this point in the history
…omes to unicode and datetime time zone info. See [http://groups.google.com/group/django-developers/browse_frm/thread/4575a3fe0d78e2e4/d607d96f7b422620#d607d96f7b422620 the django-dev thread] for details.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3675 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
jacobian committed Aug 28, 2006
1 parent 5626416 commit 0e57743
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions django/db/backends/postgresql_psycopg2/base.py
Expand Up @@ -11,10 +11,6 @@
from django.core.exceptions import ImproperlyConfigured
raise ImproperlyConfigured, "Error loading psycopg2 module: %s" % e

# Register Unicode conversions
import psycopg2.extensions
psycopg2.extensions.register_type(psycopg2.extensions.UNICODE)

DatabaseError = Database.DatabaseError

try:
Expand Down Expand Up @@ -47,6 +43,7 @@ def cursor(self):
self.connection = Database.connect(conn_string)
self.connection.set_isolation_level(1) # make transactions transparent to all cursors
cursor = self.connection.cursor()
cursor.tzinfo_factory = None
cursor.execute("SET TIME ZONE %s", [settings.TIME_ZONE])
if settings.DEBUG:
return util.CursorDebugWrapper(cursor, self)
Expand Down

0 comments on commit 0e57743

Please sign in to comment.