Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Is it Possible to Connect Odoo Server based on Database Schema?

on 3/5/16, 2:01 AM 541 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


Wennaël LOONIS
On 9/2/16, 9:02 AM


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



Ermin Trevisan

--Ermin Trevisan--
| 6 3 7
Walchwil, Switzerland
--Ermin Trevisan--

Ermin Trevisan
On 3/5/16, 2:21 AM

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.


Axel Mendoza

--Axel Mendoza--
| 6 7 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full time employee trying to understand what to do an how

Reach me at aekroft@gmail.com

Axel Mendoza
On 3/5/16, 2:49 AM

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 3/5/16, 2:01 AM
Seen: 541 times
Last updated: 9/2/16, 9:02 AM