Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#304 closed defect (duplicate)

Changes to auth.LogEntry in changeset [469] breaks Oracle backend.

Reported by: Jason Huggins Owned by: adrian
Component: Database layer (models, ORM) Version:
Severity: major Keywords: oracle TextField CharField Long
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Changeset [469] added an additional "TextField" objects to the LogEntry model.

In the Oracle backend (#87), I mapped TextField types in Django to the "Long" datatype in the db, because the Model documentaton suggests TextFields should be used to store (potentially large) html content. If I used any other string datatype (like varchar2), the max length of the field would be 4000 characters/bytes. That isn't good. Yet, again, Oracle stinks compared to PostgreSQL, because Oracle only allows one "Long" field type per table.

If LogEntry's "object_id" needs to only hold small strings, and it is going to be less than 4000 characters, I'd suggest you change it to CharField.

After changeset #469, I get this error in django-admin.py init:
"""
Error: The database couldn't be initialized. Here's the full exception:
ORA-01754: a table may contain only one column of type LONG
"""

I've confirmed that changing LogEntry's object_id field to "CharField" fixes the problem for Oracle.

Change History (2)

comment:1 Changed 10 years ago by hugo <gb@…>

You might be able to use CLOBs instead of LONG. CLOB can be indexed just as TEXT in PostgreSQL. But the query interface for CLOBs is a bit weird, as they are only accessible thru the large object API and not as a direct field, IIRC.

comment:2 Changed 9 years ago by adrian

  • Resolution set to duplicate
  • Status changed from new to closed

Marking this as a duplicate of #87.

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