From 18bcf109037f434859d9f2dc80bb44f9b0a8eeab Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Wed, 21 Nov 2018 18:17:34 +0100 Subject: [PATCH] Blind fix for a strange use-case. A user reported a case where pgloader fails to find the table an index has been created on in pgloader catalogs. That's a weird case. For now, just issue a warning about the situation and skip the index. --- src/sources/mssql/mssql-schema.lisp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/sources/mssql/mssql-schema.lisp b/src/sources/mssql/mssql-schema.lisp index 97d3d36..89be6ff 100644 --- a/src/sources/mssql/mssql-schema.lisp +++ b/src/sources/mssql/mssql-schema.lisp @@ -144,8 +144,14 @@ :columns nil :filter filter)) (index - (maybe-add-index table index-name pg-index :key #'index-name))) - (add-column index colname)) + (when table + (maybe-add-index table index-name pg-index :key #'index-name)))) + (unless table + (log-message :warning + "Failed to find table ~s in schema ~s for index ~s, skipping the index" + table-name schema-name index-name)) + (when index + (add-column index colname))) :finally (return catalog))) (defun list-all-fkeys (catalog &key including excluding)