From 2cbf7161129bab5fc879a69d552bec36b999d06b Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Thu, 14 Feb 2019 22:16:53 +0100 Subject: [PATCH] Ensure column names are double-quoted in the COPY command. In some cases we have to quote column names and it's not been done yet, for instance when dealing with PostgreSQL as a source database. Patch mostly from @m0n5t3r, only cosmetic changes applied. Thanks! Fixes #905. --- src/sources/pgsql/pgsql.lisp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sources/pgsql/pgsql.lisp b/src/sources/pgsql/pgsql.lisp index 1fd15fc..983b4d1 100644 --- a/src/sources/pgsql/pgsql.lisp +++ b/src/sources/pgsql/pgsql.lisp @@ -63,8 +63,9 @@ (cl-postgres:exec-query pomo:*database* sql map-reader)))))) (defmethod copy-column-list ((pgsql copy-pgsql)) - "We are sending the data in the MySQL columns ordering here." - (mapcar #'column-name (fields pgsql))) + "We are sending the data in the source columns ordering here." + (mapcar (lambda (field) (ensure-quoted (column-name field))) + (fields pgsql))) (defmethod fetch-metadata ((pgsql copy-pgsql) (catalog catalog)