mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-04 18:36:12 +02:00
Fix corner case in creating indexes again.
When the option "drop indexes" is in use in loading data from a file, we collect the indexes from the PostgreSQL catalogs and then issue DROP commands against them before the load, then CREATE commands when it's done. The CREATE is done in parallel, and we create an lparallel kernel for that. The kernel must have a worker-count of at least 1, and we where not considering the case of 0 indexes on the target table. Fix #484.
This commit is contained in:
parent
27b67c6cf6
commit
2dc733c4d6
@ -295,7 +295,8 @@
|
||||
(section :post)
|
||||
drop-indexes)
|
||||
"Create the indexes that we dropped previously."
|
||||
(when drop-indexes
|
||||
(when (and drop-indexes
|
||||
(< 0 (count-indexes catalog)))
|
||||
(let* ((*preserve-index-names* t)
|
||||
;; we get the list of indexes from PostgreSQL catalogs, so don't
|
||||
;; question their spelling, just quote them.
|
||||
|
||||
@ -7,8 +7,10 @@ load csv
|
||||
with fields optionally enclosed by '"',
|
||||
fields terminated by ',',
|
||||
truncate,
|
||||
workers = 8,
|
||||
concurrency = 1
|
||||
disable triggers,
|
||||
drop indexes
|
||||
-- workers = 8,
|
||||
-- concurrency = 1
|
||||
|
||||
before load do
|
||||
$$ drop table if exists matching; $$,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user