Bugs item #1541095, was opened at 2006-08-16 11:19
Message generated for change (Settings changed) made by phd
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1541095&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: SQLObject release (specify)
>Status: Closed
>Resolution: Wont Fix
Priority: 5
Submitted By: Michel Albert (exhuma)
>Assigned to: Oleg Broytmann (phd)
Summary: Capital letters in table/column names
Initial Comment:
Postgre requires table names, column names and so on
to be enclosed in double quotes if they contain
capital letters. Otherwise it assumes that they are
all lower-case. In order to be more DBMS-agnostic,
SQLObject should deal with that.
It is possible to do something like:
lastName = StringCol(dbName='"lastName"')
It would be nicer to be able to do this:
lastName = StringCol(dbName='lastName')
The current solution is error-prone. Also, when doing
this, it get's a bit confusing as you have to leave
out the quotes when doing joins:
wrong:
address = SingleJoin('"Address"')
correct:
address = SingleJoin('Address')
as the joins relate to Python objects, not directly to
tables.
I have to deal with this, as I am migrating a web-
application from PHP to Python, and the database
already exists and modifying it is not an option.
Best regards,
Michel Albert
----------------------------------------------------------------------
>Comment By: Oleg Broytmann (phd)
Date: 2006-08-22 19:03
Message:
Logged In: YES
user_id=4799
Use sqlmeta.idSequence to name your sequence.
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2006-08-16 20:45
Message:
Logged In: NO
This issue actually *breaks* postgres!:
--- In postgres: -----------------------------------
database=> SELECT NEXTVAL('"Hotel_idHotel_seq"');
nextval
---------
1
(1 row)
----------------------------------------------------
--- Using SQLObject --------------------------------
>>> x = Hotel(name="foo", address=None, owner=None,
establishment=None)
Traceback (most recent call last):
File "<console>", line 1, in ?
File "/usr/lib/python2.4/site-packages/SQLObject-
0.7.1dev_r1675-py2.4.egg/sqlobject/declarative.py", line
92, in _wrapper
return_value = fn(self, *args, **kwargs)
File "/usr/lib/python2.4/site-packages/SQLObject-
0.7.1dev_r1675-py2.4.egg/sqlobject/main.py", line 1197, in
__init__
self._create(id, **kw)
File "/usr/lib/python2.4/site-packages/SQLObject-
0.7.1dev_r1675-py2.4.egg/sqlobject/main.py", line 1224, in
_create
self._SO_finishCreate(id)
File "/usr/lib/python2.4/site-packages/SQLObject-
0.7.1dev_r1675-py2.4.egg/sqlobject/main.py", line 1248, in
_SO_finishCreate
id, names, values)
File "/usr/lib/python2.4/site-packages/SQLObject-
0.7.1dev_r1675-py2.4.egg/sqlobject/dbconnection.py", line
759, in queryInsertID
return self._dbConnection._queryInsertID(
File "/usr/lib/python2.4/site-packages/SQLObject-
0.7.1dev_r1675-py2.4.egg/sqlobject/postgres/
pgconnection.py", line 126, in _queryInsertID
c.execute("SELECT NEXTVAL('%s')" % sequenceName)
ProgrammingError: ERROR: invalid name syntax
SELECT NEXTVAL('"Hotel"_"idHotel"_seq')
----------------------------------------------------
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1541095&group_id=74338
|