1
votes

Yesterday I switched from Windows 7 to Linux Mint 12. Everything has been fine so far except some issues with Django and PostgreSQL.

I run some code which reads files and writes information to the database. On Windows it runs smoothly without any exceptions, however, on Linux I constantly get this:

django.db.utils.DatabaseError: current transaction is aborted, commands ignored until end of transaction block

And the end of the log: http://pastebin.com/Uf1Jb3fe

The script is called through terminal, imports django settings and then uses ORM, but I think this is not the case as in Windows everything is just fine.

So, what should I do? By the way, try to explain the solution in a very detailed way as I'm still a newbie in Linux.

1
I started using MySQL and it's just fine, but why PgSQL raises those exceptions?aemdy

1 Answers

1
votes

The message: current transaction is aborted, commands ignored until end of transaction block is allways caused by a previous error. In this case the first INSERT in the log you posted caused a duplicate key violation.

2012-02-05 13:10:58 EET LOG: statement: INSERT INTO "upgrades_manastone" ("name", "slug", "db_id", "description", "title_colour", "worth", "level") VALUES ('Stamina XIII', '', 0, '', 'white', 1, 13) RETURNING "upgrades_manastone"."id"

2012-02-05 13:10:58 EET ERROR: duplicate key value violates unique constraint "upgrades_manastone_slug_key"

Resolve the duplicate key violation and everything should be fine.