mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-04 18:36:12 +02:00
Fix corner cases and how we log them.
In the prepare-pgsql-database method we were logging too much details, such as DDL warnings on if-not-exists for successful queries. And those logs are to be found in PostgreSQL server logs anyway. Also fix trying to create or drop a "nil" schema.
This commit is contained in:
parent
6c931975de
commit
5faf8605ce
@ -70,15 +70,17 @@
|
||||
;; if asked, first DROP the schema CASCADE.
|
||||
(loop :for schema :in (catalog-schema-list catalog)
|
||||
:for schema-name := (schema-name schema)
|
||||
:when (member schema-name schema-list :test #'string=)
|
||||
:when (and schema-name
|
||||
(member schema-name schema-list :test #'string=))
|
||||
:do (let ((sql (format nil "DROP SCHEMA ~a CASCADE;" schema-name)))
|
||||
(pgsql-execute sql :client-min-messages client-min-messages))))
|
||||
|
||||
;; now create the schemas (again?)
|
||||
(loop :for schema :in (catalog-schema-list catalog)
|
||||
:for schema-name := (schema-name schema)
|
||||
:when (or include-drop
|
||||
(not (member schema-name schema-list :test #'string=)))
|
||||
:when (and schema-name
|
||||
(or include-drop
|
||||
(not (member schema-name schema-list :test #'string=))))
|
||||
:do (let ((sql (format nil "CREATE SCHEMA ~a;" (schema-name schema))))
|
||||
(pgsql-execute sql :client-min-messages client-min-messages)))))
|
||||
|
||||
|
||||
@ -31,7 +31,9 @@
|
||||
(with-stats-collection ("Create Schemas" :section :pre
|
||||
:use-result-as-read t
|
||||
:use-result-as-rows t)
|
||||
(create-schemas catalog :include-drop include-drop)))
|
||||
(create-schemas catalog
|
||||
:include-drop include-drop
|
||||
:client-min-messages :error)))
|
||||
|
||||
(if create-tables
|
||||
(progn
|
||||
@ -100,7 +102,9 @@
|
||||
(with-stats-collection ("Create MatViews Tables" :section :pre
|
||||
:use-result-as-read t
|
||||
:use-result-as-rows t)
|
||||
(create-views catalog :include-drop include-drop))))
|
||||
(create-views catalog
|
||||
:include-drop include-drop
|
||||
:client-min-messages :error))))
|
||||
|
||||
;; log the catalog we just fetched and (maybe) merged
|
||||
(log-message :data "CATALOG: ~s" catalog))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user