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:
Dimitri Fontaine 2016-11-20 17:17:15 +01:00
parent 27b67c6cf6
commit 2dc733c4d6
2 changed files with 6 additions and 3 deletions

View File

@ -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.

View File

@ -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; $$,