mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-04 10:31:02 +02:00
Quote table names when migrating from SQLite, fix #281.
Apparently I just forgot to apply any smartness whatsoever to SQLite identifiers and just copied them as they are to PostgreSQL. Change that by calling apply-identifier-case.
This commit is contained in:
parent
573a63cd3a
commit
75727df72f
@ -16,6 +16,7 @@
|
||||
(defmethod open-connection ((slconn sqlite-connection) &key)
|
||||
(setf (conn-handle slconn)
|
||||
(sqlite:connect (fd-path slconn)))
|
||||
(log-message :debug "CONNECTED TO ~a" (fd-path slconn))
|
||||
slconn)
|
||||
|
||||
(defmethod close-connection ((slconn sqlite-connection))
|
||||
@ -235,7 +236,7 @@
|
||||
(truncate
|
||||
(truncate-tables (target-db sqlite) (mapcar #'car all-columns))))
|
||||
|
||||
(cl-postgres::database-errror (e)
|
||||
(cl-postgres:database-error (e)
|
||||
(declare (ignore e)) ; a log has already been printed
|
||||
(log-message :fatal "Failed to create the schema, see above.")
|
||||
(return-from copy-database)))
|
||||
@ -248,7 +249,7 @@
|
||||
:source-db (source-db sqlite)
|
||||
:target-db (target-db sqlite)
|
||||
:source table-name
|
||||
:target table-name
|
||||
:target (apply-identifier-case table-name)
|
||||
:fields columns)))
|
||||
;; first COPY the data from SQLite to PostgreSQL, using copy-kernel
|
||||
(unless schema-only
|
||||
|
||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user