Search code examples
postgresqlodooodoo-10

Odoo 10 - Can't access Postgresql (9.5) via pgAdmin4 even with pg_hba.conf changes


Need access to the Odoo postgresql DB (via pgAdmin 4). Even with the changes made to pg_hba.conf it won't connect.

# Database administrative login by Unix domain socket
local   all             postgres                                peer

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
host    all             all             [Our Networks IP]/32       md5
host    postgres        odoo            [Our Networks IP]/32       trust
host    SLWK_PRE-PROD_DB        odoo            [Our Networks IP]/32       md5
# IPv6 local connections:
host    all             all             ::1/128                 md5

Is my format wrong or am I missing something else? I've tried connecting via bash as a super user and it won't let me query stuff either.

I've already tried editing the pg_hba.config with different settings but no avail.

When trying to connect via pgAdmin 4 the following error appears:

FATAL: no pg_hba.conf entry for host "[Our Networks IP]", user "odoo", database "postgres", SSL on
FATAL: no pg_hba.conf entry for host "[Our Networks IP]", user "odoo", database "postgres", SSL off

Solution

  • Solved the issue by putting the AWS EC2 instance IP in the pg_hba.conf in the Unix-domain socket fields. Was putting my configuration in the TCP/IP part of the pg_hba.conf.