You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE; CREATE EXTENSION IF NOT EXISTS postgis;
Then I create the following table:
CREATE TABLE aisdk ( ID SERIAL NOT NULL, Time TIMESTAMPTZ NOT NULL, MMSI INT NOT NULL, Navstatus SMALLINT NULL, Shiptype SMALLINT NULL, ROT SMALLINT NULL, SOG SMALLINT NULL, COG SMALLINT NULL, GEOM GEOGRAPHY NOT NULL, PRIMARY KEY(ID, time) );
Then I convert the table to a hypertable: SELECT create_hypertable('aisdk', 'time');
I have 2 CSV Files (can be downloaded below)
The first one contrains dates that are less than 13/01/2019
The second one has dates larger than 13/01/2019
The first table uploads perfectly with dates ranging from 01/01/2019 00:00:00 - 02/01/2019 23:59:59, (about 180 million rows), then I get the following error
panic: pq: date/time field value out of range: "13/01/2019 00:00:00"
I have checked my database datestyle, it is already DMY
If i use psql to upload the data like this it works: \COPY aisdk FROM 'S://temp/csv/done/PP_aisdk_20190113.csv' DELIMITER ',' CSV HEADER;
I guess it has something do with the pq driver...it somehow thinks the datestyle is MDY and panics.
My current soloution is to change my date fromat in the csv files YYYY/MM/DD and somehow it works!
The text was updated successfully, but these errors were encountered:
As mentioned in timescale#31, lib/pq appears to ignore the DateStyle setting and
formats timestamps with MDY order. This has been serendipitously fixed
by switching to the pgx driver; add a test to make sure it doesn't
regress again.
System
I have a database named "aisdk".
I add the and postgis and timescale extensions:
CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;
CREATE EXTENSION IF NOT EXISTS postgis;
Then I create the following table:
CREATE TABLE aisdk ( ID SERIAL NOT NULL, Time TIMESTAMPTZ NOT NULL, MMSI INT NOT NULL, Navstatus SMALLINT NULL, Shiptype SMALLINT NULL, ROT SMALLINT NULL, SOG SMALLINT NULL, COG SMALLINT NULL, GEOM GEOGRAPHY NOT NULL, PRIMARY KEY(ID, time) );
Then I convert the table to a hypertable:
SELECT create_hypertable('aisdk', 'time');
I have 2 CSV Files (can be downloaded below)
The first one contrains dates that are less than 13/01/2019
The second one has dates larger than 13/01/2019
The files look like this:
PP_aisdk_20190101.csv
PP_aisdk_20190113.csv
I use the following flags with timescaledb-parallel-copy.exe
timescaledb-parallel-copy --db-name=aisdk --table=aisdk --connection postgresql://postgres:postgres@localhost:5432/aisdk?sslmode=disable --skip-header --reporting-period 1s --file PP_aisdk_20190113.csv --workers 16
The first table uploads perfectly with dates ranging from 01/01/2019 00:00:00 - 02/01/2019 23:59:59, (about 180 million rows), then I get the following error
panic: pq: date/time field value out of range: "13/01/2019 00:00:00"
I have checked my database datestyle, it is already DMY
If i use psql to upload the data like this it works:
\COPY aisdk FROM 'S://temp/csv/done/PP_aisdk_20190113.csv' DELIMITER ',' CSV HEADER;
I guess it has something do with the pq driver...it somehow thinks the datestyle is MDY and panics.
My current soloution is to change my date fromat in the csv files YYYY/MM/DD and somehow it works!
The text was updated successfully, but these errors were encountered: