diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index 9e5b76bab5d4e0e673ae0ad43059d9dd778aa8a8..cb515be8f3a4c911456da7fc6a5efdea3cb28b60 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.86 1998/10/14 05:31:48 momjian Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.87 1999/01/17 03:37:19 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -584,9 +584,12 @@ connectDB(PGconn *conn) if (connect(conn->sock, &conn->raddr.sa, conn->raddr_len) < 0) { (void) sprintf(conn->errorMessage, - "connectDB() failed: Is the postmaster running and accepting%s connections at '%s' on port '%s'?\n", - conn->pghost ? " TCP/IP(with -i)" : "", - conn->pghost ? conn->pghost : "UNIX Socket", + "connectDB() -- connect() failed: %s\n" + "Is the postmaster running%s at '%s' and accepting connections on %s '%s'?\n", + strerror(errno), + (family == AF_INET) ? " (with -i)" : "", + conn->pghost ? conn->pghost : "localhost", + (family == AF_INET) ? "TCP/IP port" : "Unix socket", conn->pgport); goto connect_errReturn; }