;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: postgresql-loader.cl,v 1.7 2002/05/13 22:05:21 kevin Exp $
+;;;; $Id: postgresql-loader.cl,v 1.12 2002/05/27 17:19:30 kevin Exp $
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
(defvar *postgresql-library-loaded* nil
"T if foreign library was able to be loaded successfully")
-(defmethod clsql-sys:database-type-library-loaded ((database-type
+(defmethod clsql-base-sys:database-type-library-loaded ((database-type
(eql :postgresql)))
*postgresql-library-loaded*)
-(defmethod clsql-sys:database-type-load-foreign ((database-type
+(defmethod clsql-base-sys:database-type-load-foreign ((database-type
(eql :postgresql)))
- (when
- (uffi:load-foreign-library
- (uffi:find-foreign-library "libpq"
- '("/opt/postgresql/lib/" "/usr/local/lib/"
- "/usr/lib/" "/postgresql/lib/"
- "/usr/local/pgsql/lib/" "/usr/lib/pgsql/"
- "/opt/pgsql/lib/pgsql")
- :drive-letters '("C" "D" "E"))
-
- :module "postgresql"
- :supporting-libraries
- *postgresql-supporting-libraries*)
- (setq *postgresql-library-loaded* t)))
+ (let ((libpath (uffi:find-foreign-library
+ "libpq"
+ '("/opt/postgresql/lib/" "/usr/local/lib/"
+ "/usr/lib/" "/postgresql/lib/"
+ "/usr/local/pgsql/lib/" "/usr/lib/pgsql/"
+ "/opt/pgsql/lib/pgsql")
+ :drive-letters '("C" "D" "E"))))
+ (if (uffi:load-foreign-library libpath
+ :module "postgresql"
+ :supporting-libraries
+ *postgresql-supporting-libraries*)
+ (setq *postgresql-library-loaded* t)
+ (warn "Can't load PostgreSQL client library ~A" libpath))))
+
+(clsql-base-sys:database-type-load-foreign :postgresql)
-(clsql-sys:database-type-load-foreign :postgresql)
-(when (clsql-sys:database-type-library-loaded :postgresql)
- (clsql-sys:initialize-database-type :database-type :postgresql)
- (pushnew :postgresql cl:*features*))