pgloader/test/csv-trim-extra-blanks.load
Dimitri Fontaine 07c614c170 Switch to the newer cl-csv API.
Thanks to the work at https://github.com/AccelerationNet/cl-csv/pull/12 we
can now use the main branch of cl-csv again.
2014-01-11 18:28:24 +01:00

21 lines
722 B
Fish

LOAD CSV
FROM INLINE
INTO postgresql:///pgloader?nulls (f1, f2, f3)
WITH truncate,
trim unquoted blanks,
fields optionally enclosed by '"',
fields escaped by double-quote,
fields terminated by ','
BEFORE LOAD DO
$$ drop table if exists nulls; $$,
$$ create table if not exists nulls (id serial, f1 text, f2 text, f3 text); $$;
"quoted empty string","","should be empty string"
"no value between separators",,"should be null"
"quoted blanks"," ","should be blanks"
"unquoted blanks", ,"should be null"
"unquoted string",no quote,"should be 'no quote'"
"quoted separator","a,b,c","should be 'a,b,c'"
"trim extra blanks", test string , "should be 'test string'"