I am trying to create a foreign data wrapper in pgAdmin, everything looks fine in terms of installing the wrapper extension, create a foreign data wrapper server, create a user map, until the very last step 'import foreign schema'.
CREATE SCHEMA AAA
IMPORT FOREIGN SCHEMA PUBLIC
from server xxx
into AAA;
Error: could not connect to server xxx
Detail: could not translate host name xxx to address: name or service not known
SQL state: 08001
so what's wrong with my hostname?
The system DNS resolver could not look up the IP address of the hostname because, as it says, "name or service not known". Since 'xxx' is presumably not the real hostname, all I can say is figure out what the real hostname should be and then use it, or bypass DNS by plugging in the IP address directly.
This failure location is expected. None of the preceding steps attempt to contact the server, and so would not realize they were given an invalid one.