Skip to content

Instantly share code, notes, and snippets.

@cbess
Created June 17, 2011 16:00
Show Gist options
  • Save cbess/1031701 to your computer and use it in GitHub Desktop.
Save cbess/1031701 to your computer and use it in GitHub Desktop.
django 1.3 postgresql schema (search path) fix for inspectdb and db connection
= Modify: django.core.management.commands.inspectdb
- line 33, add
- cursor.execute("SET search_path TO myschema")
- line 80, change to
- field_type = 'ForeignKey(\'%s\'' % rel_to
- now you can ignore the model ordering
= Modify: django.db.backends.postgres_psycopg2.base
- line 147, add
- cursor.execute("SET search_path TO myschema")
- You may need to add the above line to lines 46 and 55, so that it happens during each execute
- C. Bess
@nareshguggilla
Copy link

Any idea about how to fix the search path in 1.8?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment