Skip to Content
Menu
This question has been flagged
3 Replies
7042 Views

Hi   All,


My  requirement  is  that  i  have  Single  Postgres  database  with  Multiple  Schema  says  biz-dev,biz-prod,biz-qa


So,   is  it possible  that  I  want  to  start  Odoo first  instance to  biz-dev schema,  next  instance  to 

biz-prod  Schema and  so  on...



please  guide  me  how  to  setup  this  scinario


Thanks

Avatar
Discard
Best Answer

Hi

It is an issue we encountered to manage a common data repository.

The solution is to use combined techniques to make believe Odoo works on separate databases:

- A login redirection via pgbouncer: when Odoo wants to connect on a specific database, it redirects to a common database containing all schemas, with a specific user

- A search_path set according to a user: the specific user log to the unique base and has in his search_path a priority: the schema database

- Create views pg_catalog pointing to the catalog in order to restrict the visibility: the views are created in the schema to restrict the view to the pattern pg_catalog

Be Aware, this is a trick to bypass the standard operating Odoo. This works, but must be fully qualified

Regards,

Avatar
Discard
Best Answer

I'm not sure if this would work, you would have to set up different Odoo instances on different ports with external database connections pointing to the same Postgres installation. I don't know if the Odoo Database Manager/Selector would work in this scenario.

I do not understand the reason for such a scenario.
I'd suggest implementing either completely separate Odoo instances with separate Postgres instances or do a common multi-database setup using dbfilter configuration parameter.

Avatar
Discard
Best Answer

That scenarios definitely will not work. I tried that for OpenERP 6.1, 7.0 and Odoo 8( the same apply for Odoo 9) and you couldn't do it using the actual ORM of Odoo because it's not schema aware and the thing is the I have tried to change it a little but there is so much code to rewrite and also there is no a solid base for that scenario. PostgreSQL is not MySQL where schemas are truly necessary. Here you have the option of create others Odoo databases or create others PostgreSQL instances for isolating more your data or whatever you need but not schemas with Odoo, simply it will not work

Avatar
Discard