Opened 14 years ago

Closed 14 years ago

#14328 closed (invalid)

Table name with CAPs symbols. DatabaseError: column...

Reported by: halturin Owned by: nobody
Component: Database layer (models, ORM) Version: 1.2
Severity: 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

here is traceback in the django shell:

$ python ./manage.py shell
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from common.models import Agent
>>> from common.models import AgentCID
>>> ag = Agent.objects.get(id=18)
>>> cid = AgentCID.objects.get(id=18)
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/usr/local/lib/python2.6/dist-packages/django/db/models/manager.py", line 132, in get
    return self.get_query_set().get(*args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/django/db/models/query.py", line 336, in get
    num = len(clone)
  File "/usr/local/lib/python2.6/dist-packages/django/db/models/query.py", line 81, in __len__
    self._result_cache = list(self.iterator())
  File "/usr/local/lib/python2.6/dist-packages/django/db/models/query.py", line 269, in iterator
    for row in compiler.results_iter():
  File "/usr/local/lib/python2.6/dist-packages/django/db/models/sql/compiler.py", line 672, in results_iter
    for rows in self.execute_sql(MULTI):
  File "/usr/local/lib/python2.6/dist-packages/django/db/models/sql/compiler.py", line 727, in execute_sql
    cursor.execute(sql, params)
  File "/usr/local/lib/python2.6/dist-packages/django/db/backends/util.py", line 15, in execute
    return self.cursor.execute(sql, params)
  File "/usr/local/lib/python2.6/dist-packages/django/db/backends/postgresql_psycopg2/base.py", line 44, in execute
    return self.cursor.execute(query, args)
DatabaseError: column AgentCID.cidmsess does not exist
LINE 1: ..."."id", "AgentCID"."cid", "AgentCID"."cidstatus", "AgentCID"...
                                                             ^

db postgresql. table AgentCID:

atic=> \d "AgentCID"
                                    Table "public.AgentCID"
   Column    |          Type          |                        Modifiers                        
-------------+------------------------+---------------------------------------------------------
 id          | integer                | not null default nextval('"AgentCID_id_seq"'::regclass)
 cid         | character varying(200) | not null
 cidstatus   | integer                | not null
 agent_id    | integer                | not null
 baseurl     | character varying(200) | not null
 authurl     | character varying(200) | 
 authokurl   | character varying(200) | 
 authfailurl | character varying(200) | 
 cookname    | character varying(200) | not null
 cooktype    | integer                | not null
 cooklen     | integer                | not null
 lang        | character varying(8)   | not null
Indexes:
    "AgentCID_pkey" PRIMARY KEY, btree (id)
    "AgentCID_agent_id" btree (agent_id)
Referenced by:
    TABLE ""UserProfile"" CONSTRAINT "UserProfile_cid_id_fkey" FOREIGN KEY (cid_id) REFERENCES "AgentCID"(id) DEFERRABLE INITIALLY DEFERRED

atic=> SELECT * from "AgentCID" where id=18;
 id | cid | cidstatus | agent_id |        baseurl         | authurl | authokurl | authfailurl |  cookname  | cooktype | cooklen | lang 
----+-----+-----------+----------+------------------------+---------+-----------+-------------+------------+----------+---------+------
 18 |     |         0 |       16 | http://example.com     |         |           |             | ATMSession |        0 |      20 | en
(1 row)

Change History (2)

comment:1 by halturin, 14 years ago

Component: UncategorizedDatabase layer (models, ORM)

comment:2 by halturin, 14 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top