+(defmethod clsql-sys:database-type-library-loaded ((database-type
+ (eql :postgresql)))
+ *postgresql-library-loaded*)
+
+(defmethod clsql-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)))
+
+(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*))