File: csv-filename-pattern.load

package info (click to toggle)
pgloader 3.1.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,192 kB
  • ctags: 867
  • sloc: lisp: 6,913; makefile: 238; sh: 82; sql: 55
file content (12 lines) | stat: -rw-r--r-- 376 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
load csv
    from all filenames matching ~<matching.*csv$>
         in directory 'data'
         having fields (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); $$;