Is the FDW host IP 10.252.86.4 reachable from the source PostgreSQL server?
This could likely be the root cause, the source PostgreSQL server (a managed Azure PaaS) cannot directly connect to that private IP.
Azure PostgreSQL managed instances have outbound restrictions:
You cannot SSH into the managed instance to test connectivity, but you can try:
Using an Azure VM in the same subnet/VNet as the source server to test connectivity to the foreign IP.
If the two servers are in different VNets, set up VNet peering or use public endpoints.
Try using the public IP of the target PostgreSQL in the FDW server definition instead of private IP
Since external ODBC connects work, the public endpoint is reachable. Example:
CREATE SERVER foreign_server
FOREIGN DATA WRAPPER postgres_fdw
OPTIONS (host 'public-ip-or-dns-name-of-target', port '5432', dbname 'target_db');
Make sure the firewall on the target server allows the IP of the source server or Azure subnet:
Check firewall rules on the target Azure PostgreSQL to allow inbound connections from the source server’s outbound IP.
If security requires private IPs only:
Consider setting up Azure Private Link / Private Endpoint and ensure both servers are in peered VNets with proper routing.