I need to run queries against postgres. Postgres runs on a kubernetes PODs (HA architecture). In the old system this was done by copying a script onto the POD and run it locally. If I try that now, I get:
>psql: FATAL: no pg_hba.conf entry for host "[local]" my_RO_user
From some research it seems better-practice to run my query from another machine. I can find the master POD. What would I need as connect-string and query-string?
Note that /pgdata/pg11/pg_hba.conf contains:
# Do not edit this file manually!
# It will be overwritten by Patroni!
local all "postgres" peer
hostssl replication "_crunchyrepl" all cert
hostssl "postgres" "_crunchyrepl" all cert
host all "_crunchyrepl" all reject
host all "ccp_monitoring" "127.0.0.0/8" md5
host all "ccp_monitoring" "::1/128" md5
local all postgres peer
hostssl replication _crunchyrepl all cert
hostssl postgres _crunchyrepl all cert
host all _crunchyrepl all reject
hostssl all all all md5
host platform_analytics_wh mstr_pa all password
The database is analysisdb
, the user is rouser
, and the database listens on port 5432.
Can anyone suggest a way forward? Either fix that pg_hba error, or clarify how to query remotely?
Asked by Koos Schut
(31 rep)
Jul 4, 2025, 08:51 AM
Last activity: Jul 4, 2025, 11:18 AM
Last activity: Jul 4, 2025, 11:18 AM