I'm having a bit of a problem using the appname/sql/model.sql custom sql files.
Running: $ python manage.py syncdb root Gives: Installing custom SQL for root.Status model Installing custom SQL for root.Target model Installing custom SQL for root.Reference model Installing custom SQL for root.Sequence model Installing custom SQL for root.Upload model Installing custom SQL for root.Library model Failed to install custom SQL for root.Library model: insert or update on table "root_upload" violates foreign key constraint "lib_id_refs_id_6bb65980" DETAIL: Key (lib_id)=(2) is not present in table "root_library". Traceback (most recent call last): File "manage.py", line 11, in ? execute_manager(settings) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/ lib/python2.4/site-packages/django/core/management/__init__.py", line 180, in execute_manager utility.execute(argv) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/ lib/python2.4/site-packages/django/core/management/__init__.py", line 124, in execute command.execute(*args[1:], **options.__dict__) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/ lib/python2.4/site-packages/django/core/management/base.py", line 34, in execute output = self.handle(*args, **options) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/ lib/python2.4/site-packages/django/core/management/base.py", line 118, in handle return self.handle_noargs(**options) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/ lib/python2.4/site-packages/django/core/management/commands/ syncdb.py", line 105, in handle_noargs transaction.rollback_unless_managed() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/ lib/python2.4/site-packages/django/db/transaction.py", line 145, in rollback_unless_managed connection._rollback() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/ lib/python2.4/site-packages/django/db/backends/__init__.py", line 24, in _rollback return self.connection.rollback() psycopg2.InterfaceError: connection already closed But running: $ python manage.py sqlcustom root | psql eureka Completes wihtout errors. So, I'm fairly certain that the custom sql is not being run in a single transaction like I would think it should if I can't specificaly order my scripts so that I populate tables that are referenced by foreign keys first. Plus, I'd assume this is a big reason why all the constraints are deferred too. So, anyone have any insights? Thanks, Paul Davis --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---