[SQLObject] Re: Postgres: DROP table CASCADE
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Ian B. <ia...@co...> - 2004-11-29 17:01:52
|
What version of Postgres are you using? This might be a version issue there, as I'm pretty sure at least some versions of Postgres support CASCADE. Maybe we have to do a version check on the pg server, though I'm not really sure how to do that (some pg_ table, I guess). Oleg Broytmann wrote: > Traceback (most recent call last): > File "/usr/local/src/SQL/SQLObject-inheritance/tests/SQLObjectTest.py", line 131, in setUp > c.dropTable(ifExists=True, cascade=True) > File "/usr/local/lib/python2.3/site-packages/sqlobject/main.py", line 1150, in dropTable > conn.dropTable(cls._table, cascade) > File "/usr/local/lib/python2.3/site-packages/sqlobject/postgres/pgconnection.py", line 96, in dropTable > self.query("DROP TABLE %s %s" % (tableName, > File "/usr/local/lib/python2.3/site-packages/sqlobject/dbconnection.py", line 205, in query > return self._runWithConnection(self._query, s) > File "/usr/local/lib/python2.3/site-packages/sqlobject/dbconnection.py", line 126, in _runWithConnection > val = meth(conn, *args) > File "/usr/local/lib/python2.3/site-packages/sqlobject/dbconnection.py", line 202, in _query > self._executeRetry(conn, conn.cursor(), s) > File "/usr/local/lib/python2.3/site-packages/sqlobject/dbconnection.py", line 197, in _executeRetry > return cursor.execute(query) > ProgrammingError: ERROR: parser: parse error at or near "CASCADE" > > DROP TABLE so_validation CASCADE > > AFAII Postgres does not support CASCADE. Exactly opposite - it is > MySQL who supports it... to some extent. MySQL silently ignores CASCADE. > But Postgres actively opposes it. > > Can I remove dropTable() from sqlobject/postgres/pgconnection.py in > the trunk? > > Oleg. |