Code

#18941 closed Bug (needsinfo)

django.db.backends.oracle reported ORA-01882: timezone region not found

Reported by: konglingkai@… Owned by: nobody
Component: Database layer (models, ORM) Version: 1.4
Severity: Normal Keywords: db oracle
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

this seem to be a problem on line 487 of django.db.oracle.base.py:

cursor.execute("ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'"

" NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24:MI:SS.FF'"
" NLS_TERRITORY = 'AMERICA'"

line487 ===> + (" TIME_ZONE = 'UTC'" if settings.USE_TZ else ))

Repro of the issue:

The bug will happen when I have "USE_TZ=True" in the project settings (which is default), and I happen not to have UTC timezone on the oracle server, there is no way for me to change the TIME_ZONE settings, the only way is to turn off USE_TZ.

the fix can be having UTC as default, and read from settings instead of hard code here.

Attachments (0)

Change History (1)

comment:1 Changed 20 months ago by aaugustin

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to needsinfo
  • Status changed from new to closed

A default install of the free version Oracle XE, which is the most stripped down version of Oracle, has a definition of UTC by default. I assume that more complete versions of Oracle also do.

Did you remove it?

(If we really want to change something, we can use '+00:00' instead of 'UTC', or we can document that a definition of the UTC timezone is required; but this certainly doesn't justify Yet Another Setting.)

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.