mirror of
https://github.com/dimitri/pgloader.git
synced 2025-08-08 15:27:00 +02:00
The cvs-parse-date test is failing on Travis because the server up there in the Cloud isn't using the same timezone as my local machine. Let's just force the timezone in the SET clause...
31 lines
809 B
Fish
31 lines
809 B
Fish
LOAD CSV
|
|
FROM inline
|
|
(
|
|
"row num",
|
|
ts [date format 'YYYY-MM-DD HH24-MI-SS.US'],
|
|
hr [date format 'HH24.MI.SS']
|
|
)
|
|
INTO postgresql:///pgloader?dateformat ("row num", ts, hr)
|
|
|
|
WITH truncate,
|
|
fields optionally enclosed by '"',
|
|
fields escaped by double-quote,
|
|
fields terminated by ','
|
|
|
|
SET timezone to 'Europe/Paris',
|
|
work_mem to '12MB',
|
|
standard_conforming_strings to 'on'
|
|
|
|
BEFORE LOAD DO
|
|
$$ drop table if exists dateformat; $$,
|
|
$$ create table dateformat (
|
|
"row num" smallint,
|
|
ts timestamptz,
|
|
hr time
|
|
);
|
|
$$;
|
|
|
|
1,1999-10-02 00-33-12.123456,"00.05.02"
|
|
2,2014-10-02 00-33-13.123456,"18.25.52"
|
|
3,2014-10-02 00-33-14.123456,13.14.15
|