django - Avoid RETURN postgresql statment in django1.4 and postgresql 8.1 related to bug #10467 -


a few days ago write project in django1.4 using admin capabilities intention make crud debug data migrated legacy system new system (the migration wasn't entirely successful), write using django 1.4 , copy of production database in laptop, in linux use postgresql9.1, so, when tried config project testing databes in original server (postgresql8.1) got errors in syncdb , migrate statments:

file "/home/diegueus9/webapps/fixsysandinos/local/lib/python2.7/site-packages/django/db/backends/util.py", line 40, in execute     return self.cursor.execute(sql, params)   file "/home/diegueus9/webapps/fixsysandinos/local/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 52, in execute     return self.cursor.execute(query, args) django.db.utils.databaseerror: syntax error @ or near "returning" line 1: ...") values (e'permission', e'auth', e'permission') returning ... 

so, did little research , found ticket #10467 (currently closed) in django, says use of statment returning introduces error in postgresql 8.1, because doesn't support syntax until 8.2 (i think), bug appears closed 8 months ago think in point reintroduced. in thread of tickets says problem can related autocommit behavior , talks connection.features.can_return_id_from_insert.

so questions are:

it bug have reopened? must disable autocommit behavior , assume risks (i don't hope so) or maybe through settings can set connection.features.can_return_id_from_insert false , in way accomplish goal?

when upgrade database or downgrade django version not option because requirement of client, can still django1.4 under own responsability can disable return statement setting can_return_id_from_insert false in django.db.backends.postgresql_psycopg2.base in line 77. affects behavior of django must or should use virtualenvwrapper


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -