mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-05 02:46:10 +02:00
Fix error reporting of catalogs.
The internal catalog representation are deeply recursive in order to make it easy to traverse the catalog both downwards (catalog to schema to tables) and upward (table to its schema to its catalog). In consequence we need to set *print-circles* to non-nil when we're going to log the catalogs, so turn it to non-nil before generating the log messages. While at it, add logging of such catalogs in the :data log verbosity mode. The catalog output is very verbose, but it's easy to copy/paste it from a bug report into being a live object we can inspect in the REPL, thanks to Common Lisp notion of a reader and readable printer!
This commit is contained in:
parent
7070f82976
commit
3569980378
@ -98,7 +98,10 @@
|
||||
(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))))
|
||||
|
||||
;; log the catalog we just fetched and (maybe) merged
|
||||
(log-message :data "CATALOG: ~s" catalog))
|
||||
|
||||
(defmethod cleanup ((copy db-copy) (catalog catalog) &key materialize-views)
|
||||
"In case anything wrong happens at `prepare-pgsql-database' step, this
|
||||
|
||||
@ -121,6 +121,8 @@
|
||||
(list (column-name col)))
|
||||
(table-field-list (first (table-list pgsql-catalog))))))
|
||||
|
||||
(log-message :data "CATALOG: ~s" pgsql-catalog)
|
||||
|
||||
;; this sets (table-index-list (target copy))
|
||||
(maybe-drop-indexes pgsql-catalog :drop-indexes drop-indexes)
|
||||
|
||||
|
||||
@ -194,12 +194,12 @@
|
||||
(log-message
|
||||
;; cl-log:log-message is a macro, we can't use apply
|
||||
;; here, so we need to break a level of abstraction
|
||||
(let ((mesg (if (log-message-arguments event)
|
||||
(format nil "~{~}"
|
||||
(log-message-description event)
|
||||
(log-message-arguments event))
|
||||
(log-message-description event)))
|
||||
(*print-circle* t))
|
||||
(let* ((*print-circle* t)
|
||||
(mesg (if (log-message-arguments event)
|
||||
(format nil "~{~}"
|
||||
(log-message-description event)
|
||||
(log-message-arguments event))
|
||||
(log-message-description event))))
|
||||
(cl-log:log-message (log-message-category event) "~a" mesg)))
|
||||
|
||||
(new-label
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user