r7061: initial property settings
[clsql.git] / db-postgresql / postgresql-sql.lisp
index ce95c333e9bd4d3343728a197a0f7e0effdbb7c3..09b72e7bae61ef47adc41ebf46248d95b370f47b 100644 (file)
@@ -2,13 +2,13 @@
 ;;;; *************************************************************************
 ;;;; FILE IDENTIFICATION
 ;;;;
-;;;; Name:          postgresql-sql.sql
+;;;; Name:          postgresql-sql.lisp
 ;;;; Purpose:       High-level PostgreSQL interface using UFFI
 ;;;; Programmers:   Kevin M. Rosenberg based on
 ;;;;                Original code by Pierre R. Mai 
 ;;;; Date Started:  Feb 2002
 ;;;;
-;;;; $Id: postgresql-sql.lisp,v 1.2 2003/06/23 19:25:30 kevin Exp $
+;;;; $Id$
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
   (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)))
   (lo-unlink (database-conn-ptr database) object-id))
 
 (when (clsql-base-sys:database-type-library-loaded :postgresql)
-  (clsql-base-sys:initialize-database-type :database-type :postgresql)
-  (pushnew :postgresql cl:*features*))
+  (clsql-base-sys:initialize-database-type :database-type :postgresql))