mirror of
https://github.com/dimitri/pgloader.git
synced 2025-08-08 23:37:00 +02:00
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.
18 lines
478 B
Fish
18 lines
478 B
Fish
load csv
|
|
from all filenames matching ~<matching.*csv$>
|
|
in directory 'data'
|
|
having fields (id, field)
|
|
into postgres:///pgloader?matching
|
|
|
|
with fields optionally enclosed by '"',
|
|
fields terminated by ',',
|
|
truncate,
|
|
disable triggers,
|
|
drop indexes
|
|
-- workers = 8,
|
|
-- concurrency = 1
|
|
|
|
before load do
|
|
$$ drop table if exists matching; $$,
|
|
$$ create table matching(id int, field text); $$;
|