#2591: manage.py inspectdb causes exception on postgresql_psycopg2 backend
-----------------------------------+----------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: adrian
Status: new | Component: django-admin.py
inspectdb
Version: SVN | Resolution:
Keywords: | Stage: Accepted
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
-----------------------------------+----------------------------------------
Comment (by [EMAIL PROTECTED]):
I ran into the same thing ("python manage.py inspectdb", with
DATABASE_ENGINE='postgresql_psycopg2').
A coworker suggested the same change as markus (originator of this
ticket), and it "works", but is guaranteed to BREAK under the database
engines it was originally tested with.
Here's a goofy little kludge I came up with that only changes one line,
DOES work in postgresql_psycopg2, and PROBABLY won't break under other
database engines.
/django/db/backends/postgresql_psycopg2/introspection.py, line 35:
#relations[int(row[0][1:-1]) - 1] = (int(row[1][1:-1]) - 1,
row[2]) ### original version
relations[int(str(row[0])[1:-1]) - 1] =
(int(str(row[1])[1:-1]) - 1, row[2]) ### goofy kludge (works w/ postgres
WITHOUT breaking others?)
I'm a total noob so I'm not submitting this as a "patch"; it's just a
goofy suggestion (but does seem to work).
--
Ticket URL: <http://code.djangoproject.com/ticket/2591#comment:12>
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
-~----------~----~----~----~------~----~------~--~---