X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=create-sql.lisp;h=d145ad9255f8c08c8c60d593800cb6c2ec5cc1ab;hb=cdaa9cb65482eaca5a8eafbbe7b3bec9fb157512;hp=4a4413a1aa2e93e7f1f4431c7fb6ed66fedbfcf2;hpb=f4ea91e2cf0eb22db02498e54d1f75ef5dcd4239;p=umlisp.git diff --git a/create-sql.lisp b/create-sql.lisp index 4a4413a..d145ad9 100644 --- a/create-sql.lisp +++ b/create-sql.lisp @@ -128,7 +128,7 @@ (format nil " (~d)" length) ""))) ((:postgresql :postgresql-socket) - ;; FIXME: incorrect syntax + ;; FIXME: incorrect syntax for postgresql? (if (integerp length) (format nil "substr((~A)::text,1,~D)" colname length) colname)) @@ -262,7 +262,8 @@ This is much faster that using create-umls-db-insert." (sql-create-indexes conn) (sql-create-custom-tables conn) (sql-create-indexes conn +custom-index-cols+) - (sql-create-special-tables conn)))) + (sql-create-special-tables conn))) + t) (defun translate-all-files (&optional (extension "-trans")) "Copy translated files and return postgresql copy commands to import" @@ -294,13 +295,10 @@ This is much faster that using create-umls-db-insert." (incf translated-lines))) (dolist (input-ufile input-ufiles) (with-umls-ufile (line input-ufile) - (incf input-lines) - (when (> input-lines translated-lines) - (throw 'done-counting 'incomplete))))) + (incf input-lines) + (when (> input-lines translated-lines) + (throw 'done-counting 'incomplete))))) (cond - ((eql input-lines 0) - (error "Input lines is 0") - nil) ((< input-lines translated-lines) (format t "Translated file ~A incomplete, deleting...~%" output-path) (delete-file output-path) @@ -308,6 +306,9 @@ This is much faster that using create-umls-db-insert." ((eql input-lines translated-lines) (format t "Translated file ~A already exists: skipping...~%" output-path) t) + ((eql input-lines 0) + (warn "The number of input lines is 0 for output file ~A." output-path) + nil) ((> translated-lines input-lines) (error "Shouldn't happen. Translated lines of ~A is ~D, greater than input lines ~D" output-path translated-lines input-lines)