Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8062701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:45:36+00:00 2026-06-05T10:45:36+00:00

A few days ago I write a project in django1.4 using the admin capabilities

  • 0

A few days ago I write a project in django1.4 using the admin capabilities with the intention to make a CRUD for debug data migrated from a legacy system to a new system (the migration wasn’t entirely successful), I write it using django 1.4 and with a copy of production database in my laptop, but in my linux I use postgresql9.1, so, when I tried to config the project to a testing databes in the original server (postgresql8.1) I got errors in the syncdb and 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 at or near "RETURNING"
LINE 1: ...") VALUES (E'permission', E'auth', E'permission') RETURNING ...

So, I did a little research and I found the ticket #10467 (currently closed) in django, which says that the use of statment RETURNING introduces an error in postgresql 8.1, because it doesn’t support that syntax until 8.2 (I think), the bug appears as closed 8 months ago but I think in some point was reintroduced. In the thread of the tickets says that the problem can be related to autocommit behavior and talks about connection.features.can_return_id_from_insert.

So the questions are:

It is a bug that have to be reopened? I must disable autocommit behavior and assume the risks (I don’t hope so) or maybe through settings I can set connection.features.can_return_id_from_insert to False and in this way accomplish my goal?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T10:45:38+00:00Added an answer on June 5, 2026 at 10:45 am

    When upgrade the database or downgrade your django version is not an option because is a requirement of a client, you can still django1.4 under your own responsability you can disable the RETURN statement setting can_return_id_from_insert to False in django.db.backends.postgresql_psycopg2.base in the line 77. But this affects the behavior of django so you really must or should use something like virtualenvwrapper

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a beginner in PHP. 2 days ago I write few lines of code
A few days ago, I asked why its not possible to store binary data,
A few days ago I posted this question: switch statement and loops using jquery/javascript
a few days ago, I developed a WinForms application in C# using VC#2010 Express.
Few days ago Membase started working very slow. We are using local moxi proxy
few days ago i asked about how to get all running processes in the
few days ago i read tutorial about GenericRepository and Unit Of Work patterns http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application
A few days ago I set up a small development server. Running on Windows
A few days ago, I updated my homepage with a new design as shown
A few days ago VS 2010 went in Beta test and usually with new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.