Opened 19 years ago

Last modified 19 years ago

#1823 closed defect

set timezone in pgsql is not working right — at Version 2

Reported by: w4kpm@… Owned by: Adrian Holovaty
Component: contrib.admin Version: dev
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Adrian Holovaty)

set timezone command for postgres is currently "set time zone . . ." which crashes.

should be "set timezone to"

===================================================================
--- django/db/backends/postgresql/base.py       (revision 2868)
+++ django/db/backends/postgresql/base.py       (working copy)
@@ -39,7 +39,7 @@
             self.connection = Database.connect(conn_string)
             self.connection.set_isolation_level(1) # make transactions transparent to all cursors
         cursor = self.connection.cursor()
-        cursor.execute("SET TIME ZONE %s", [settings.TIME_ZONE])
+        cursor.execute("SET TIMEZONE %s", [settings.TIME_ZONE])
         if settings.DEBUG:
             return util.CursorDebugWrapper(cursor, self)
         return cursor

Thanks,
Kelly

Change History (2)

comment:1 by Adrian Holovaty, 19 years ago

I'm wondering why this has worked, in its current form, for several years. Are you on a peculiar version of Postgres?

comment:2 by Adrian Holovaty, 19 years ago

Description: modified (diff)

Fixed description

Note: See TracTickets for help on using tickets.
Back to Top