Bugs item #1429248, was opened at 2006-02-10 20:00
Message generated for change (Settings changed) made by phd
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1429248&group_id=74338
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Postgres
Group: None
>Status: Closed
Resolution: Wont Fix
Priority: 5
Submitted By: Hootbah (hootbah)
Assigned to: Oleg Broytmann (phd)
Summary: tableExists query issues with uper case table names
Initial Comment:
Its is possible for the tableExists query not to find a
table when it does actually exist.
When using uppercase names e.g.
class sqlmeta:
table = 'MYTABLE'
The tableExists query becomes:
SELECT COUNT(relname) FROM pg_class WHERE relname =
'MYTABLE'
This fails to find the table as the table names stored
within pg_class are all lower case.
I propose to change the query to be:
SELECT COUNT(relname) FROM pg_class WHERE relname =
lower('MYTABLE')
This would mean a change to pgconnection.py:
result = self.queryOne("SELECT COUNT(relname) FROM
pg_class WHERE relname = lower(%s)"
% self.sqlrepr(tableName))
----------------------------------------------------------------------
Comment By: Oleg Broytmann (phd)
Date: 2006-03-27 18:51
Message:
Logged In: YES
user_id=4799
The fix would break case-sensitive names. You don't want to
make this lowercase:
class sqlmeta:
table = '"MYTABLE"'
Instead just write the name lower-cased:
class sqlmeta:
table = 'mytable'
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1429248&group_id=74338
|