fixed a recurring redefinition problem in cl-postgresql-socket3
authorRuss Tyndall <russ@acceleration.net>
Fri, 2 Oct 2009 20:31:49 +0000 (16:31 -0400)
committerRuss Tyndall <russ@acceleration.net>
Fri, 2 Oct 2009 20:31:49 +0000 (16:31 -0400)
db-postgresql-socket3/package.lisp
db-postgresql-socket3/sql.lisp

index f2ff36872302e19a2bcee3930f6a1ad104e18339..430b2eb0948a04b3dbd885e25cfae77c1fc4b6be 100644 (file)
@@ -22,6 +22,7 @@
 
 (defpackage #:postgresql-socket3
   (:use #:cl md5 #:cl-postgres)
+  (:shadow #:postgresql-warning)
   (:export #:+postgresql-server-default-port+
           #:postgresql-condition
           #:postgresql-error
index 04b18974d52bb7f8157e3690f1272d16bb190283..6fdef8e1c6b8ea7c404a722f371975cbb9f9acb1 100644 (file)
   (ecase *backend-warning-behavior*
     (:warn
      (warn 'sql-database-warning :database database
-           :message (postgresql-condition-message condition)))
+           :message (cl-postgres:database-error-message condition)))
     (:error
      (error 'sql-database-error :database database
             :message (format nil "Warning upgraded to error: ~A"
-                             (postgresql-condition-message condition))))
+                             (cl-postgres:database-error-message condition))))
     ((:ignore nil)
      ;; do nothing
      )))
@@ -72,7 +72,7 @@
          :database database
          :expression expression
          :error-id (type-of condition)
-         :message (postgresql-condition-message condition)))
+         :message (cl-postgres:database-error-message condition)))
 
 (defmacro with-postgresql-handlers
     ((database &optional expression)
@@ -84,7 +84,7 @@
        (handler-bind ((postgresql-warning
                        (lambda (c)
                          (convert-to-clsql-warning ,database-var c)))
-                      (postgresql-error
+                      (cl-postgres:database-error
                        (lambda (c)
                          (convert-to-clsql-error
                           ,database-var ,expression-var c))))
                :database-type database-type
                :connection-spec connection-spec
                :error-id (type-of c)
-               :message (postgresql-condition-message c)))
+               :message (cl-postgres:database-error-message c)))
       (:no-error (connection)
                  ;; Success, make instance
                  (make-instance 'postgresql-socket3-database