r1799: added transaction support
[clsql.git] / interfaces / postgresql / postgresql-sql.cl
index 21cb247eed7b7defced65805d84835a814e59711..809507c2e341e04752671612bc9faf432d962da5 100644 (file)
@@ -8,7 +8,7 @@
 ;;;;                Original code by Pierre R. Mai 
 ;;;; Date Started:  Feb 2002
 ;;;;
-;;;; $Id: postgresql-sql.cl,v 1.13 2002/04/19 20:25:20 marc.battyani Exp $
+;;;; $Id: postgresql-sql.cl,v 1.15 2002/04/27 20:58:11 kevin Exp $
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
@@ -87,6 +87,9 @@
   ((conn-ptr :accessor database-conn-ptr :initarg :conn-ptr
             :type pgsql-conn-def)))
 
+(defmethod database-type ((database postgresql-database))
+  :postgresql)
+
 (defmethod database-name-from-spec (connection-spec (database-type
                                                     (eql :postgresql)))
   (check-connection-spec connection-spec database-type
        (make-instance 'postgresql-database
                       :name (database-name-from-spec connection-spec
                                                      database-type)
+                      :connection-spec connection-spec
                       :conn-ptr connection)))))
 
 
           (setf length (lo-lseek ptr fd 0 2))
           (lo-lseek ptr fd 0 0)
           (when (> length 0)
-            (setf buffer (uffi:allocate-foreign-string length :type '(:unsigned :byte)))
+            (setf buffer (uffi:allocate-foreign-string 
+                          length :unsigned t))
             (when (= (lo-read ptr fd buffer length) length)
               (setf result (uffi:convert-from-foreign-string
                             buffer :length length :null-terminated-p nil))))))