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.
This commit is contained in:
Dimitri Fontaine 2019-02-14 22:16:53 +01:00
parent 0caa9c30ce
commit 2cbf716112

View File

@ -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)