PostgreSQL“DatabaseError:当前事务被中止”

时间:2014-02-08 18:16:56

标签: python django postgresql

我安装了OSQA并且我同步了(syncdbmigrate)数据库并重新启动了Apache。 在浏览器中,我得到了HTTP状态 200错误,在项目日志中,我收到了很多错误:

DatabaseError: current transaction is aborted, commands ignored until end of transaction block

我还在 PostgreSQL 的日志中发现了这些错误:

LOG:  statement: SELECT "forum_keyvalue"."id", "forum_keyvalue"."key", "forum_keyvalue"."value" FROM "forum_keyvalue" WHERE "forum_keyvalue"."key" = 'FORM_EMPTY_QUESTION_BODY' 
ERROR:  relation "forum_keyvalue" does not exist at character 85
STATEMENT:  SELECT "forum_keyvalue"."id", "forum_keyvalue"."key", "forum_keyvalue"."value" FROM "forum_keyvalue" WHERE "forum_keyvalue"."key" = 'FORM_EMPTY_QUESTION_BODY' 
LOG:  statement: SELECT "forum_keyvalue"."id", "forum_keyvalue"."key", "forum_keyvalue"."value" FROM "forum_keyvalue" WHERE "forum_keyvalue"."key" = 'FORM_MIN_NUMBER_OF_TAGS' 
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  SELECT "forum_keyvalue"."id", "forum_keyvalue"."key", "forum_keyvalue"."value" FROM "forum_keyvalue" WHERE "forum_keyvalue"."key" = 'FORM_MIN_NUMBER_OF_TAGS' 
LOG:  statement: SELECT "forum_keyvalue"."id", "forum_keyvalue"."key", "forum_keyvalue"."value" FROM "forum_keyvalue" WHERE "forum_keyvalue"."key" = 'FORM_MAX_NUMBER_OF_TAGS' 
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  SELECT "forum_keyvalue"."id", "forum_keyvalue"."key", "forum_keyvalue"."value" FROM "forum_keyvalue" WHERE "forum_keyvalue"."key" = 'FORM_MAX_NUMBER_OF_TAGS' 
LOG:  statement: SELECT "forum_keyvalue"."id", "forum_keyvalue"."key", "forum_keyvalue"."value" FROM "forum_keyvalue" WHERE "forum_keyvalue"."key" = 'FORM_EMPTY_QUESTION_BODY' 
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  SELECT "forum_keyvalue"."id", "forum_keyvalue"."key", "forum_keyvalue"."value" FROM "forum_keyvalue" WHERE "forum_keyvalue"."key" = 'FORM_EMPTY_QUESTION_BODY' 
LOG:  statement: SELECT "forum_keyvalue"."id", "forum_keyvalue"."key", "forum_keyvalue"."value" FROM "forum_keyvalue" WHERE "forum_keyvalue"."key" = 'MIN_USERNAME_LENGTH' 
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  SELECT "forum_keyvalue"."id", "forum_keyvalue"."key", "forum_keyvalue"."value" FROM "forum_keyvalue" WHERE "forum_keyvalue"."key" = 'MIN_USERNAME_LENGTH' 
LOG:  statement: SELECT "forum_badge"."id" FROM "forum_badge"
ERROR:  current transaction is aborted, commands ignored until end of transaction block

我在StackOverflow和I found it上搜索了问题的解决方案:

  

要消除错误,请回滚最后一个(错误的)事务   在修复代码之后:

     

from django.db import transaction transaction.rollback()

此解决方案对我不起作用。
我在Python2.7,Django-1.3.7和PostgreSQL 9.1.11上运行我的应用程序。 任何帮助表示赞赏!非常感谢你,抱歉我的英语不好。

0 个答案:

没有答案