;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: postgresql-loader.lisp,v 1.2 2002/11/23 18:00:26 kevin Exp $
-;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
;;;; CLSQL users are granted the rights to distribute and use this software
;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
;;;; *************************************************************************
-(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0)))
-(in-package :postgresql)
+(in-package #:pgsql)
(defvar *postgresql-supporting-libraries* '("crypt" "c")
(defvar *postgresql-library-loaded* nil
"T if foreign library was able to be loaded successfully")
-(defmethod clsql-base-sys:database-type-library-loaded ((database-type
- (eql :postgresql)))
+(defmethod clsql-sys:database-type-library-loaded ((database-type
+ (eql :postgresql)))
*postgresql-library-loaded*)
-
-(defmethod clsql-base-sys:database-type-load-foreign ((database-type
- (eql :postgresql)))
- (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" "/sw/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)
+
+(defmethod clsql-sys:database-type-load-foreign ((database-type
+ (eql :postgresql)))
+ (clsql-uffi:find-and-load-foreign-library "libpq"
+ :module "postgresql"
+ :supporting-libraries *postgresql-supporting-libraries*)
+ (setq *postgresql-library-loaded* t))
+
+(clsql-sys:database-type-load-foreign :postgresql)