#5710: dumpdata/loaddata fails with many-to-many tables on postgresql
------------------------------------+---------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: nobody
Status: new | Component: Database wrapper
Version: SVN | Keywords: manage.py loaddata dumpdata
postgresql
Stage: Unreviewed | Has_patch: 1
------------------------------------+---------------------------------------
I did a (manage.py) dumpdata then loaddata with some models that had many
to many fields. The subsequent loaddata operation failed with an error:
{{{
psycopg2.ProgrammingError: relation "keywordsites_site__site__keywords"
does not exist.
}}}
The problem is that the name of the table is reduced to lower case where
the name of the table is actually has an uppercase S
{{{
keywordsites_site__Site__keywords
}}}
and further investigation revealed that the generated SQL had the correct
capitalisation but the table name was not quoted - hence the problem.
The fix is to change line 96 on
django/db/backends/postgresql/operations.py to:
{{{
output.append("%s setval('%s', coalesce(max(%s), 1),
max(%s) %s null) %s \"%s\";" % \
}}}
No idea how to make a .diff, sorry, but for a single line I'm sure you can
cope. It would be nice to be able to turn WikiFormatting off inline too.
--
Ticket URL: <http://code.djangoproject.com/ticket/5710>
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
-~----------~----~----~----~------~----~------~--~---