Hi,
I get the error:
CREATE INDEX CONCURRENTLY cannot run inside a transaction block
I use PostgreSQL 9.0 and django 1.3
I tried this patther, but this does not work:
db.commit_transaction()
db.execute('''CREATE INDEX CONCURRENTLY ...''')
db.start_transaction()
(traceback below)
Any hint how to create the index CONCURRENTLY?
Thomas Güttler
Traceback (most recent call last):
File "/home/modwork_eins_d/djangotools/bin/manage.py", line 74, in <module>
execute_manager(etc.settings)
File "/home/modwork_eins_d/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/home/modwork_eins_d/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/modwork_eins_d/django/core/management/base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "/home/modwork_eins_d/django/core/management/base.py", line 220, in execute
output = self.handle(*args, **options)
File "/home/modwork_eins_d/south/management/commands/migrate.py", line 107, in handle
ignore_ghosts = ignore_ghosts,
File "/home/modwork_eins_d/south/migration/__init__.py", line 219, in migrate_app
success = migrator.migrate_many(target, workplan, database)
File "/home/modwork_eins_d/south/migration/migrators.py", line 235, in migrate_many
result = migrator.__class__.migrate_many(migrator, target, migrations, database)
File "/home/modwork_eins_d/south/migration/migrators.py", line 310, in migrate_many
result = self.migrate(migration, database)
File "/home/modwork_eins_d/south/migration/migrators.py", line 133, in migrate
result = self.run(migration)
File "/home/modwork_eins_d/south/migration/migrators.py", line 107, in run
return self.run_migration(migration)
File "/home/modwork_eins_d/south/migration/migrators.py", line 84, in run_migration
south.db.db.rollback_transaction()
File "/home/modwork_eins_d/south/db/generic.py", line 942, in rollback_transaction
transaction.leave_transaction_management()
File "/home/modwork_eins_d/django/db/transaction.py", line 56, in leave_transaction_management
connection.leave_transaction_management()
File "/home/modwork_eins_d/django/db/backends/__init__.py", line 111, in leave_transaction_management
raise TransactionManagementError("This code isn't under transaction "
django.db.transaction.TransactionManagementError: This code isn't under transaction management
--
Thomas Guettler,
http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de