mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-04 10:31:02 +02:00
Handle failure to convert index filters gracefully.
We should not block any processing just because we can't parse an index. The best we can do just tonight is to try creating the index without the filter, ideally we would have to skip building the index entirely. That's for a later effort though, it's running late here. See #365.
This commit is contained in:
parent
ac7f326447
commit
e2fcd86868
@ -364,7 +364,18 @@
|
||||
(defmethod process-index-definitions ((table table) &key sql-dialect)
|
||||
"Rewrite all index filter in TABLE."
|
||||
(loop :for index :in (table-index-list table)
|
||||
:do (let ((pg-filter (translate-index-filter table index sql-dialect)))
|
||||
:do (let ((pg-filter
|
||||
(handler-case
|
||||
(translate-index-filter table index sql-dialect)
|
||||
(condition (c)
|
||||
(log-message :error
|
||||
"Failed to translate index ~s on table ~s because of filter clause ~s"
|
||||
(pgsql-index-name index)
|
||||
(format-table-name table)
|
||||
(pgsql-index-filter index))
|
||||
(log-message :debug "filter translation error: ~a" c)
|
||||
;; try to create the index without the WHERE clause...
|
||||
(setf (pgsql-index-filter index) nil)))))
|
||||
(log-message :info "tranlate-index-filter: ~s" pg-filter)
|
||||
(setf (pgsql-index-filter index) pg-filter))))
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user