pg_hba.conf trustは使用しないでください !!! trust つまり、パスワードは不要であり、それはあなたが望んでいることではないと思います。
これは正しい構成です
host all all 0.0.0.0/0 md5
/0に注意してください 0.0.0.0の背後 。
完全なpg_hba.conf これである必要があります:-
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
host all all 0.0.0.0/0 md5
trustに注意してください localにのみ適用されます 接続。つまり、ローカルホストIP 127.0.0.1で実行されているアプリケーションの場合 postgresqlサーバーも実行しているマシン上。