1

Recent I meet a problem while using tdengine, "timestamp out of range " error.I was not very understand about this. I had double check my timestamp, and i'm sure that is correct. The follows are my SQL:

create table test (ts timestamp,k int,val binary(20));

insert into test values('1970-01-01 08:00:00',1,'one');

insert into test values(0,1,'one');

'1970-01-01 08:00:00' is the date string and the 0 is the timestamp for '1970-01-01 08:00:00'. what's more , both of the insert clause occurred same error.

DB error: Timestamp data out of range (0.014000s)

I don't know what's going on there, these insert clause is not worked in both taos-jdbc or taos client CLI. Is anyone know what the matter is ? Thank you.

Ray Shown
  • 33
  • 6

1 Answers1

1

Form the documentation:

CREATE DATABASE [IF NOT EXISTS] db_name [KEEP keep] [DAYS days] [UPDATE 1]

Note:

KEEP is how long the data of the database is kept, the default is 3650 days (10 years), and the database will automatically delete the data expired;

if you want to store data older than 10 year, you should adjust the keep value when creating the database.

Xiao Ping
  • 326
  • 1
  • 7