From 2363d8845f2a5a8f2ae2f48634e81670309e5be2 Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Thu, 6 Jul 2017 09:48:03 +0200 Subject: [PATCH] Fix create schema handling in data only scenarios. In b301aa93948f05b5189382f641cf1e040fc655f2 the "create schema" default changed to true, which is a good idea. As a consequence pgloader should consider this operation only when "create tables" is set: we don't want to start with creating target schemas in a target database that is said to be ready to host the data. --- src/sources/common/db-methods.lisp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/sources/common/db-methods.lisp b/src/sources/common/db-methods.lisp index 5d1adca..29fb797 100644 --- a/src/sources/common/db-methods.lisp +++ b/src/sources/common/db-methods.lisp @@ -30,16 +30,16 @@ (setf (catalog-types-without-btree catalog) (list-typenames-without-btree-support)) - (when create-schemas - (with-stats-collection ("Create Schemas" :section :pre - :use-result-as-read t - :use-result-as-rows t) - (create-schemas catalog - :include-drop include-drop - :client-min-messages :error))) - (if create-tables (progn + (when create-schemas + (with-stats-collection ("Create Schemas" :section :pre + :use-result-as-read t + :use-result-as-rows t) + (create-schemas catalog + :include-drop include-drop + :client-min-messages :error))) + ;; create new SQL types (ENUMs, SETs) if needed and before we ;; get to the table definitions that will use them (with-stats-collection ("Create SQL Types" :section :pre