pgloader/test/csv-header.load
Dimitri Fontaine b4bfa18877 Fix more table name quoting, fix #163 again.
Now that we can have several threads doing COPY, each of them need to
know about the *pgsql-reserved-keywords* list. Make sure that's the case
and in passing fix some call sites to apply-identifier-case.

Also, more disturbingly, fix the code so that TRUNCATE is called from
the main thread before giving control to the COPY threads, rather than
having two concurrent threads doing the TRUNCATE twice. It's rather
strange that we got no complaint from the field on that part...
2015-12-08 11:52:43 +01:00

26 lines
546 B
Fish

LOAD CSV
FROM INLINE
INTO postgresql:///pgloader?"group"
WITH truncate,
fields terminated by ',',
csv header
BEFORE LOAD DO
$$ drop table if exists "group"; $$,
$$ CREATE TABLE "group"
(
somefields text,
rekplcode text,
"repl$grpid" text,
"repl$id" text,
another text,
fields text
)
$$;
somefields,reklpcode,repl$grpid,repl$id,another,fields
a,b,c,d,e,f
foo,bar,baz,quux,foobar,fizzbuzz