From e76a4c8f5a5c5d98780a66104cc806189a2dab5c Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Fri, 4 Sep 2015 12:17:57 +0200 Subject: [PATCH] Error early when failing to match IXF type. Our IXF type matching appears to be incomplete, and pgloader would then happily try to create a table column of type NIL in PostgreSQL: prevent that from happening by raising an error condition early. Fix #289. --- src/sources/ixf/ixf-schema.lisp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sources/ixf/ixf-schema.lisp b/src/sources/ixf/ixf-schema.lisp index fb37663..30c2052 100644 --- a/src/sources/ixf/ixf-schema.lisp +++ b/src/sources/ixf/ixf-schema.lisp @@ -41,7 +41,11 @@ (defun cast-ixf-type (ixf-type) "Return the PostgreSQL type name for a given IXF type name." - (cdr (assoc ixf-type *ixf-pgsql-type-mapping*))) + (let ((pgtype + (cdr (assoc ixf-type *ixf-pgsql-type-mapping*)))) + (unless pgtype + (error "IXF Type mapping unknown for: ~x" ixf-type)) + pgtype)) (defmethod format-pgsql-column ((col ixf:ixf-column)) "Return a string reprensenting the PostgreSQL column definition"