PostgreSQL ODBC: what goes in the Server box for a LAN server, and "Could not connect to the server; connect failed for [address:5432]"

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

  1. In the Server entry put the IP address of the machine that runs the SQL engine, or its server name, such as bigserver or myserver.com.
  2. If the connect still fails, check that port 5432 is open on the server.
  3. Check the firewall on the server, and that PostgreSQL is set up to accept remote connections.
  4. Read the file pg_hba.conf in the share folder under the PostgreSQL folder; its section on non-local connections lists the settings you may need.
  5. 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.