      (number? val)       (long val)
      :else               (try
                            (Long/parseLong val)
-                           (catch Exception _ default)))))
+                           (catch Exception _ (long default))))))
 
 ;; Warning Postgres type float is equivalent to java Double, and Postgres real is equivalent to java Float
 (defn val->float

     (number? val)        (float val)
     :else                (try
                            (Float/parseFloat val)
                            (catch Exception _ default)))))

;; Warning Postgres type float is equivalent to java Double, and Postgres real is equivalent to java Float
(defn val->double

     (number? val)          (double val)
     :else                  (try
                              (Double/parseDouble val)
                              (catch Exception _ (double default))))))

(defn val->bool
  ([val]
