我使用Django,只是刪除並重新創建數據庫以刷新表數據。現在,當我試圖做任何數據庫相關的任務,我得到:psycopg2.InternalError不管我做什麼
./manage.py sql portfolio
Traceback (most recent call last):
File "./manage.py", line 11, in <module>
execute_manager(settings)
File "/usr/lib/pymodules/python2.6/django/core/management/__init__.py", line 362, in execute_manager
utility.execute()
File "/usr/lib/pymodules/python2.6/django/core/management/__init__.py", line 303, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/pymodules/python2.6/django/core/management/base.py", line 195, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/lib/pymodules/python2.6/django/core/management/base.py", line 222, in execute
output = self.handle(*args, **options)
File "/usr/lib/pymodules/python2.6/django/core/management/base.py", line 286, in handle
app_output = self.handle_app(app, **options)
File "/usr/lib/pymodules/python2.6/django/core/management/commands/sql.py", line 10, in handle_app
return u'\n'.join(sql_create(app, self.style)).encode('utf-8')
File "/usr/lib/pymodules/python2.6/django/core/management/sql.py", line 28, in sql_create
tables = connection.introspection.table_names()
File "/usr/lib/pymodules/python2.6/django/db/backends/__init__.py", line 491, in table_names
return self.get_table_list(cursor)
File "/usr/lib/pymodules/python2.6/django/db/backends/postgresql/introspection.py", line 30, in get_table_list
AND pg_catalog.pg_table_is_visible(c.oid)""")
File "/usr/lib/pymodules/python2.6/django/db/backends/util.py", line 19, in execute
return self.cursor.execute(sql, params)
psycopg2.InternalError: BŁĄD: current transaction is aborted, commands ignored until end of transaction block
正如你可以看到它只是代碼生成,所以不應該與交易有任何問題。這是怎麼回事? :-(
仍然得到了錯誤,但我可以通過暫時增加創建SQL: 高清get_table_list(個體經營,光標):「返回表名的當前數據庫列表」 回報[] in /usr/lib/pymodules/python2.6/django/db/backends/postgresql/introspection.py 使用其他命令時仍然出錯 – Ziells 2010-02-17 19:37:25