#3214: raw sql file doesn't recognize quotes correctly
--------------------------------------------+-------------------------------
Reporter: shaunc <[EMAIL PROTECTED]> | Owner: adrian
Status: new | Component: Database wrapper
Version: | Resolution:
Keywords: | Stage: Unreviewed
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
--------------------------------------------+-------------------------------
Changes (by shaunc <[EMAIL PROTECTED]>):
* has_patch: 0 => 1
Comment:
I've attached a patch for this bug: with patch management.py will use
utility "sql_statement_iterator" which splits sql into statements more
carefully, respecting quotes and comments.
Also, it will change freestanding '%' to double -- otherwise these cause
an error in management.py, as python DB2.0 spec treats all non-doubled
percent signs as substitution targets, which isn't wanted in this
situation.
With this fix I'm able to use pg_dump (with appropriate flags to use
'insert' rather than 'copy') to dump old tables, then cut and paste
resulting inserts (and set sequence) into initial data.
utils/sqltools.py, where "sql_statement_iterator" lives, has doctests.
Ideally I would have written unit tests for both this and new management,
but, ... well maybe I'll get to it after I deploy next edition of our
website :).
--
Ticket URL: <http://code.djangoproject.com/ticket/3214#comment:3>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django
updates" 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-updates?hl=en
-~----------~----~----~----~------~----~------~--~---