diff -Naur psqlodbc-08.00.0004/socket.c psqlodbc-08.00.0004.patch/socket.c
--- psqlodbc-08.00.0004/socket.c	2005-01-28 23:36:20.000000000 +0200
+++ psqlodbc-08.00.0004.patch/socket.c	2005-02-27 16:20:34.993553000 +0200
@@ -109,7 +109,11 @@
 
 
 char
-SOCK_connect_to(SocketClass *self, unsigned short port, char *hostname)
+SOCK_connect_to(SocketClass *self, unsigned short port, char *hostname
+#ifdef HAVE_UNIX_SOCKETS
+		, char *uds /* unix domain socket path */
+#endif
+		)
 {
 #if defined (POSIX_MULTITHREAD_SUPPORT)
 	const int bufsz = 8192; 
@@ -140,7 +144,7 @@
 
 
 	/*
-	 * If it is a valid IP address, use it. Otherwise use hostname lookup.
+	 * If it is a valid IP address, use it. Otherwise use AF_UNIX socket.
 	 */
 	if (hostname && hostname[0])
 	{
@@ -196,7 +200,7 @@
 		}
 		un->sun_family = family = AF_UNIX;
 		/* passing NULL means that this only suports the pg default "/tmp" */
-		UNIXSOCK_PATH(un, port, ((char *) NULL));
+		UNIXSOCK_PATH(un, port, uds);
 		sLen = UNIXSOCK_LEN(un);
 		self->sadr = (struct sockaddr *) un;
 	}
diff -Naur psqlodbc-08.00.0004/socket.h psqlodbc-08.00.0004.patch/socket.h
--- psqlodbc-08.00.0004/socket.h	2005-01-28 23:36:20.000000000 +0200
+++ psqlodbc-08.00.0004.patch/socket.h	2005-02-27 16:18:22.733047000 +0200
@@ -34,7 +34,7 @@
 
 #define SOCK_ERRNO	errno
 #define SOCK_ERRNO_SET(e)	(errno = e)
-#ifdef	HAVE_SYS_UN_H
+#if defined HAVE_SYS_UN_H && !defined HAVE_UNIX_SOCKETS
 #define HAVE_UNIX_SOCKETS
 #endif /* HAVE_SYS_UN_H */
 #else
@@ -121,7 +121,12 @@
 /* Socket prototypes */
 SocketClass *SOCK_Constructor(const ConnectionClass *conn);
 void		SOCK_Destructor(SocketClass *self);
-char		SOCK_connect_to(SocketClass *self, unsigned short port, char *hostname);
+char		SOCK_connect_to(SocketClass *self, unsigned short port,
+				char *hostname
+#ifdef HAVE_UNIX_SOCKETS
+				, char *uds
+#endif
+				);
 void		SOCK_get_n_char(SocketClass *self, char *buffer, int len);
 void		SOCK_put_n_char(SocketClass *self, char *buffer, int len);
 BOOL		SOCK_get_string(SocketClass *self, char *buffer, int bufsize);
