I had the same problem. At my case the solutions above didn't solve my problem.
My issue was,I'm using proxmox hypervisor. my vm servers are connected vm bridge/network which is using MTU 1400. I have to add MTU 1400 to my /etc/network/interfaces at each postgre vms
iface ens18 inet static address xxxxxx gateway xxx # dns-* options are implemented by the resolvconf package, if installed dns-nameservers xxx dns-nameservers yyy dns-search xxxx mtu 1400