r6292: updates for connection string
[clsql.git] / db-postgresql / postgresql-sql.lisp
index a199ba5494c7be6e2906d58a8bef8768e918d066..ac13a3054deb0e178d2e9a4a0af496e911f94041 100644 (file)
   (destructuring-bind (host db user password &optional port options tty)
       connection-spec
     (declare (ignore password options tty))
-    (concatenate 'string host (if port ":") (if port port) "/" db "/" user)))
+    (concatenate 'string 
+      (etypecase host
+       (pathname (namestring host))
+       (string host))
+      (when port 
+       (concatenate 'string
+                    ":"
+                    (etypecase port
+                      (integer (write-to-string port))
+                      (string port))))
+      "/" db "/" user)))
 
 
 (defmethod database-connect (connection-spec (database-type (eql :postgresql)))