mirror of
https://github.com/dimitri/pgloader.git
synced 2025-08-07 23:07:00 +02:00
When using LOAD CSV it's possible to load from filename matching a regular expression, but for that to work the *csv-path-root* needs to be properly setup at run-time.
11 lines
329 B
Fish
11 lines
329 B
Fish
load csv
|
|
from all filenames matching ~<data/matching.*csv$> (id, field)
|
|
into postgresql:///pgloader?matching
|
|
with fields optionally enclosed by '"',
|
|
fields terminated by ',',
|
|
truncate
|
|
|
|
before load do
|
|
$$ drop table if exists matching; $$,
|
|
$$ create table matching(id int, field text); $$;
|