Please make sure you made all the configuration like the following:
PostgreSQL
By default, PostgreSQL only allows connection over UNIX sockets and loopback connections (from “localhost”, the same machine the PostgreSQL server is installed on).
UNIX socket is fine if you want Odoo and PostgreSQL to execute on the same machine, and is the default when no host is provided, but if you want Odoo and PostgreSQL to execute on different machines 1 it will need to listen to network interfaces 2, either:
- Only accept loopback connections and use an SSH tunnel between the machine on which Odoo runs and the one on which PostgreSQL runs, then configure Odoo to connect to its end of the tunnel
- Accept connections to the machine on which Odoo is installed, possibly over ssl (see PostgreSQL connection settings for details), then configure Odoo to connect over the network
Configuration sample
- Allow tcp connection on localhost
- Allow tcp connection from 192.168.1.x network
in /etc/postgresql/9.5/main/pg_hba.conf set:
# IPv4 local connections:
host all all 127.0.0.1/32 md5
host all all 192.168.1.0/24 md5
in /etc/postgresql/9.5/main/postgresql.conf set:
listen_addresses = 'localhost,192.168.1.2'
port = 5432
max_connections = 80
Configuring Odoo
Out of the box, Odoo connects to a local postgres over UNIX socket via port 5432. This can be overridden using the database options when your Postgres deployment is not local and/or does not use the installation defaults.
The packaged installers will automatically create a new user (odoo) and set it as the database user.
- The database management screens are protected by the admin_passwd setting. This setting can only be set using configuration files, and is simply checked before performing database alterations. It should be set to a randomly generated value to ensure third parties can not use this interface.
- All database operations use the database options, including the database management screen. For the database management screen to work requires that the PostgreSQL user have createdb right.
Users can always drop databases they own. For the database management screen to be completely non-functional, the PostgreSQL user needs to be created with no-createdb and the database must be owned by a different PostgreSQL user.
Warning
the PostgreSQL user must not be a superuser
Configuration sample
- connect to a PostgreSQL server on 192.168.1.2
- port 5432
- using an ‘odoo’ user account,
- with ‘pwd’ as a password
- filtering only db with a name beginning with ‘mycompany’
in /etc/odoo.conf set:
[options]
admin_passwd = mysupersecretpassword
db_host = 192.168.1.2
db_port = 5432
db_user = odoo
db_password = pwd
dbfilter = ^mycompany.*$
some-time complete addons is not in other system therefore you face-error ...
you are restoreing your database on same system or in other system ?