Using other schema in PostgeSQL

20 views
Skip to first unread message

Michel Vega Fuenzalida

unread,
Apr 6, 2018, 9:15:11 PM4/6/18
to django...@googlegroups.com
Hello people,

I'm using PostgeSQL not using the public schema but a different one named: 'correo', I need to tell Django to use the that schema (I have deleted the public schema)

Thanks
--
Michel Vega Fuenzalida
Usuario Linux: 323650

Fabio C. Barrionuevo da Luz

unread,
Apr 6, 2018, 10:11:14 PM4/6/18
to django...@googlegroups.com
This is a very old issue:



I do not know if there is someone working on ORM and Migrations to fix this issue.

I've seen something like this somewhere, but I do not know if it works.

class MyTable(models.Model):
# ...
class Meta:
db_table = '"correo"."mytable"'




That said, I've seen some projects that implement multi-tenancy with Postgres Database Schemas support, but not their what black magic they use to make it work.

I personally have never used it.

https://bitbucket.org/schinckel/django-boardinghouse

https://github.com/tomturner/django-tenants

https://github.com/bernardopires/django-tenant-schemas




--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/DDE1CD0F-2A03-467A-81EF-6E6AC958017F%40nauta.cu.
For more options, visit https://groups.google.com/d/optout.



--
Fábio C. Barrionuevo da Luz
Palmas - Tocantins - Brasil - América do Sul


Blog colaborativo sobre Python e tecnologias Relacionadas, mantido totalmente no https://github.com/pythonclub/pythonclub.github.io .

Todos são livres para publicar. É só fazer fork, escrever sua postagem e mandar o pull-request. Leia mais sobre como publicar em README.md e contributing.md.
Regra básica de postagem:
"Você" acha interessante? É útil para "você"? Pode ser utilizado com Python ou é útil para quem usa Python? Está esperando o que? Publica logo, que estou louco para ler...

Jani Tiainen

unread,
Apr 7, 2018, 2:31:34 AM4/7/18
to django...@googlegroups.com
You can give search path in database options which IMO is cleanest option you can have now.


For example how to do that.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

john fabiani`

unread,
Apr 7, 2018, 8:48:41 AM4/7/18
to django...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages