#22673: inspectdb not support database schema on postgresql with name different 
of
"public"
-------------------------------------+-------------------------------------
     Reporter:  Fabio Caritas        |                    Owner:  nobody
  Barrionuevo da Luz <bnafta@…>      |
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  inspectdb,           |             Triage Stage:  Accepted
  introspection, postgresql, schema  |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Erik Cederstrand):

 I just stumbled into this because I have similar requirements, and ended
 up creating a custom
 `django.db.backends.postgresql.introspection.DatabaseIntrospection` class
 that respects the schema specified by `inspectdb --database=my_schema`. I
 also implemented a new optional `SCHEMA` entry in the postgres
 `settings.DATABASES` option dict so the inspection can pick up that value.

 The changes to the `DatabaseIntrospection` and `DatabaseWrapper` classes
 are minimal. Fallback would be to the point to the `public` schema.

 Would you be interested in patches?

 It's a bit more involved to support multiple schemas in parallel, but
 solveable by creating a custom DB router and an extra `db_schema` Meta
 option.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/22673#comment:11>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/109.066db0932454a606787840290861d2a6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to