0

I want to connect to postgres-12 from a postgres-14 server in order to get dumps from the remote.

Apparently there is a connection problem when trying to access the remote postgres server though.

postgres@dvzsn-rd5482:> hostname -I
10.4.91.68
postgres@dvzsn-rd5482:> psql -p 5449 -h 10.4.91.32
psql: error: connection to server at "10.4.91.32", port 5449 failed: FATAL:  no pg_hba.conf entry for host "10.4.91.68", user "postgres", database "postgres", SSL off

so it complains about a missing pg_hba.conf entry on the remote for 10.4.91.68

however ...

postgres@dvzsn-rd1941:> psql -p 5449 -c "SELECT * FROM pg_hba_file_rules WHERE address = '10.4.91.68';"
 line_number |   type    |  database  | user_name  |  address   |     netmask     | auth_method | options | error
-------------+-----------+------------+------------+------------+-----------------+-------------+---------+-------
          92 | host      | {all}      | {all}      | 10.4.91.68 | 255.255.255.255 | md5         |         |
          93 | hostnossl | {postgres} | {postgres} | 10.4.91.68 | 255.255.255.255 | md5         |         |
(2 rows)

in my eyses the first line should be sufficient even.

Any idea on what I am not seeing? It does not seem to be listen_addresses

 postgres@dvzsn-rd1941:> psql -c "SHOW listen_addresses"
 listen_addresses
------------------
 *
`
6
  • 2
    did you reload the database configuration? pg_hba_file_rules works with a file, while authorization uses a saved configuration in the server memory.
    – Melkij
    Commented Jan 23 at 12:17
  • In addition, make sure that 10.4.91.32 is the same as the local machine. What does the PostgreSQL server log say? Commented Jan 23 at 12:48
  • Perhaps your connection attempt matches one of the earlier 90 lines in the pg_hba file?
    – mustaccio
    Commented Jan 23 at 15:40
  • logs on the remote say the same thing: no pg_hba.conf entry for host "10.4.91.68", user "postgres", database "postgres", SSL off
    – vrms
    Commented Jan 24 at 13:31
  • i did do a pg_ctl -p 5449 reload on the remote
    – vrms
    Commented Jan 24 at 13:31

1 Answer 1

-1

Please try to change subnet mask to 255.255.255.0 as you specified 24 bytes network IP address

3
  • /24 instead of /32 does not change anything to the better either. Apart from that I have good experience with using /32 subnet (narrrowing things down to that one exact address) for those entries
    – vrms
    Commented Jan 25 at 8:19
  • Can You please attach here whole pg_hba file?
    – esternbob
    Commented Jan 25 at 10:59
  • it was resolved after all. Don't really know how and why. It is working all of a sudden with host all all 10.4.91.68/32 md5
    – vrms
    Commented Jan 25 at 12:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.