Title
#users-public
Jun Zhou

Jun Zhou

08/17/2022, 4:19 AM
Hi all, when using nifi insert data to
questdb 6.5
by postgres protocol, the value of sampletime is different from original message. Where did I go wrong? Thanks in advance. the original message:
{
  "sampletime": "2022-08-17 11:57:42.531098+08",
  "bdirelid": 1976848,
  "bdinspname": "ois",
  "bdirelname": "dorn_line",
  "bdirelpages": 128,
  "bdiexppages": "23",
  "bdidiag": "moderate amount of bloat suspected"
}
the sampletime in questdb is
1970-01-20T05:18:28.549000Z
. the table ddl :
create table gptest_df_gp_bloat_diag(
sampletime TIMESTAMP,
bdirelid    int,
bdinspname  string,
bdirelname string,
bdirelpages int,
bdiexppages string,
bdidiag    string )
timestamp(sampletime)
;
Bolek Ziobrowski

Bolek Ziobrowski

08/17/2022, 7:06 AM
Hi @Jun Zhou. Seems like you're passing timestamp value in milliseconds instead of microseconds . Please have a look at Java tab at https://questdb.io/docs/develop/insert-data/#postgresql-wire-protocol .
Jun Zhou

Jun Zhou

08/17/2022, 1:36 PM
Thanks @Bolek Ziobrowski, after I convert the value of sampletime to microsecons, then the time inserted in questdb is correct.