On Wed, 2008-06-25 at 08:49 -0700, [EMAIL PROTECTED] wrote: > Hi all, > > on a custom SQL file I have a CREATE FUNCTION statement but > apparently, when doing syncdb, the statement fails because the custom > SQL file processor thinks the statement ends on the first ; it reads. > Is this a limitation? Is there a workaround?
Yes, it's a limitation. One workaround is to write a Python function which catches the post-syncdb signal and then passes the SQL to the database yourself. You can always use django.db.connection.cursor as a direct way to interact with the database (via the execute() method). Django's "initial SQL" code is necessarily a bit restricted because many of the Python DB wrappers cannot handle multiple SQL statements at once, so we have to split them into single statements. To also handle all sorts of procedural definitions and the like, we would need a context-sensitive parser -- basically rewriting an SQL parser ourselves. That's not going to happen, since it's a lot of work for basically zero gain. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---

