You need to catch exceptions during a commit and rollback the incomplete transaction.
from django.db import connection connection._rollback() to rollback the current one. On Thu, Apr 25, 2013 at 4:08 PM, Pedro Silva <[email protected]>wrote: > I cant sync db with heroku postgresql, with sqllite works great. > Can anybody help me? > requeriments: > Django==1.4.5 > PIL==1.1.7 > distribute==0.6.36 > dj-database-url==0.2.1 > django-db-log==2.2.1 > django-log-file-viewer==0.4 > psycopg2==2.5 > virtualenv==1.9.1 > > > erro: > c:\WorkspacePY>python manage.py reset meet > Traceback (most recent call last): > File "manage.py", line 10, in <module> > execute_from_command_line(sys.**argv) > File "C:\Python27\lib\site-**packages\django\core\**management\__init__.py", > line > 443, in execute_from_command_line > utility.execute() > File "C:\Python27\lib\site-**packages\django\core\**management\__init__.py", > line > 382, in execute > self.fetch_command(subcommand)**.run_from_argv(self.argv) > File "C:\Python27\lib\site-**packages\django\core\**management\base.py", > line 196, > in run_from_argv > self.execute(*args, **options.__dict__) > File "C:\Python27\lib\site-**packages\django\core\**management\base.py", > line 232, > in execute > output = self.handle(*args, **options) > File "C:\Python27\lib\site-**packages\django\core\**management\base.py", > line 304, > in handle > app_output = self.handle_app(app, **options) > File "C:\Python27\lib\site-**packages\django\core\** > management\commands\reset.py", > line 34, in handle_app > sql_list = sql_reset(app, self.style, connection) > File "C:\Python27\lib\site-**packages\django\core\**management\sql.py", > line 107, > in sql_reset > return sql_delete(app, style, connection) + sql_all(app, style, > connection) > File "C:\Python27\lib\site-**packages\django\core\**management\sql.py", > line 66, i > n sql_delete > table_names = connection.introspection.get_**table_list(cursor) > File "C:\Python27\lib\site-**packages\django\db\backends\** > postgresql_psycopg2\int > rospection.py", line 33, in get_table_list > AND pg_catalog.pg_table_is_**visible(c.oid)""") > File "C:\Python27\lib\site-**packages\django\db\backends\**util.py", > line 40, in e > xecute > return self.cursor.execute(sql, params) > File "C:\Python27\lib\site-**packages\django\db\backends\** > postgresql_psycopg2\bas > e.py", line 52, in execute > return self.cursor.execute(query, args) > django.db.utils.DatabaseError: current transaction is aborted, commands > ignored > until end of transaction block > > sql: > 2013-04-25 11:42:54,790 [DEBUG] (0.238) > SELECT c.relname > FROM pg_catalog.pg_class c > LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace > WHERE c.relkind IN ('r', 'v', '') > AND n.nspname NOT IN ('pg_catalog', 'pg_toast') > AND pg_catalog.pg_table_is_**visible(c.oid); args=() > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/django-users?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.

