mirror of
https://github.com/dimitri/pgloader.git
synced 2026-01-22 23:51:23 +01:00
Previous patch made regression failures obvious that were hidden by strange bugs with CCL. One such regression was introduced in commit ab7e77c2d00decce64ab739d0eb3d2ca5bdb6a7e where we played with the complex code generation for field projection, where the following two cases weren't cleanly processed anymore: column text using "constant" column text using "field-name" In the first case we want to load a user-defined constant in the column, in the second case we want to load the value of the field "field-name" in the column --- we just have different source and target names. Another regression was introduced in the recent commit 01e5c2376390749c2b7041b17b9a974ee8efb6b2 where the create-table function was called too early, before we have fetched *pgsql-reserved-keywords*. As a consequence table names weren't always properly quoted as shown in the test/csv-header.load file which targets a table named "group". Finally, skip the test/dbf.load regression test when using CCL as this environment doesn't have the necessary CP850 code page / encoding.
26 lines
546 B
Fish
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,rekplcode,repl$grpid,repl$id,another,fields
|
|
a,b,c,d,e,f
|
|
foo,bar,baz,quux,foobar,fizzbuzz
|