From a939d20dff19aa3fbfb0ea3d4360f43dbd6537ae Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Sat, 1 Dec 2018 21:27:26 +0100 Subject: [PATCH] Unquote names when searching for an index column name in its table. If the source database is using a keyword (such as "order") as a column name, then pgloader is going to quote this column name in its internal catalogs. In that case, unquote the column in the pgloader catalogs when matching it against the unquoted column name we have in the index definition. Fixes #872. --- src/pgsql/pgsql-ddl.lisp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pgsql/pgsql-ddl.lisp b/src/pgsql/pgsql-ddl.lisp index 662bc95..008fe7d 100644 --- a/src/pgsql/pgsql-ddl.lisp +++ b/src/pgsql/pgsql-ddl.lisp @@ -266,7 +266,9 @@ :collect (column-type-name (find idx-col tbl-cols :test #'string-equal - :key #'column-name)))) + :key (lambda (col) + (ensure-unquoted + (column-name col))))))) (nobtree (catalog-types-without-btree (schema-catalog (table-schema (index-table index)))))) (let* ((idx-type (first idx-types))