Index: fe-connect.c =================================================================== RCS file: /home/projects/pgsql/cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v retrieving revision 1.145 diff -c -r1.145 fe-connect.c *** fe-connect.c 2000/11/13 15:18:15 1.145 --- fe-connect.c 2000/11/13 23:36:38 *************** *** 332,337 **** --- 332,356 ---- PQconninfoFree(connOptions); /* ---------- + * Allow unix socket specification in the host name + * ---------- + */ + if (conn->pghost && conn->pghost[0] == '/') + { + if (conn->pgunixsocket) + free(conn->pgunixsocket); + conn->pgunixsocket = conn->pghost; + conn->pghost = NULL; + } + if (conn->pghostaddr && conn->pghostaddr[0] == '/') + { + if (conn->pgunixsocket) + free(conn->pgunixsocket); + conn->pgunixsocket = conn->pghostaddr; + conn->pghostaddr = NULL; + } + + /* ---------- * Connect to the database * ---------- */ *************** *** 443,455 **** else conn->pgport = strdup(pgport); ! #if FIX_ME ! /* we need to modify the function to accept a unix socket path */ ! if (pgunixsocket) ! conn->pgunixsocket = strdup(pgunixsocket); ! else if ((tmp = getenv("PGUNIXSOCKET")) != NULL) ! conn->pgunixsocket = strdup(tmp); ! #endif if (pgtty == NULL) { --- 462,486 ---- else conn->pgport = strdup(pgport); ! /* ---------- ! * We don't allow unix socket path as a function parameter. ! * This allows unix socket specification in the host name. ! * ---------- ! */ ! if (conn->pghost && conn->pghost[0] == '/') ! { ! if (conn->pgunixsocket) ! free(conn->pgunixsocket); ! conn->pgunixsocket = conn->pghost; ! conn->pghost = NULL; ! } ! if (conn->pghostaddr && conn->pghostaddr[0] == '/') ! { ! if (conn->pgunixsocket) ! free(conn->pgunixsocket); ! conn->pgunixsocket = conn->pghostaddr; ! conn->pghostaddr = NULL; ! } if (pgtty == NULL) { *************** *** 778,784 **** { printfPQExpBuffer(&conn->errorMessage, "connectDBStart() -- " ! "invalid host address: %s\n", conn->pghostaddr); goto connect_errReturn; } --- 809,815 ---- { printfPQExpBuffer(&conn->errorMessage, "connectDBStart() -- " ! "invalid host address: %s\n", conn->pghostaddr); goto connect_errReturn; }