Applies to: the PostgreSQL ODBC driver, as reported in 2011; no Clarion or PostgreSQL version is named.
Problem
The poster did not know what to type in the Server entry of the PostgreSQL ODBC window to reach a server on the LAN (not localhost). After he typed the server he got: Could not connect to the server; connect failed for [192.168.1.101:5432].
Solution
- In the Server entry put the IP address of the machine that runs the SQL engine, or its server name, such as
bigserverormyserver.com. - If the connect still fails, check that port 5432 is open on the server.
- Check the firewall on the server, and that PostgreSQL is set up to accept remote connections.
- Read the file
pg_hba.confin the share folder under the PostgreSQL folder; its section on non-local connections lists the settings you may need. - A DSN-less connection string was also offered as an example:
Driver=PostgreSQL ODBC Driver(UNICODE);server=213.251.168.51;UID=xxxxxxxx;PWD=xxxxxxxx;database=xxxxxxxx;PORT=5432;
Caveats
- The poster did not report back after the second message, so the thread does not show which step fixed it.
- The driver name in a connection string must match the name your ODBC administrator lists; the example above is one poster's spelling.
- The address in the example string is content of that example, not a recommendation.
Today (2026)
Likely unchanged: the Server box, port 5432, the firewall and pg_hba.conf are the usual places on current PostgreSQL versions. Not re-tested.
Sources: Gonzalo (Mar 2011, the question), Pierre T., Sean H., JP G., Rocky P., Don S. (Mar 2011) in softvelocity.clarion.databasedrivers.