to get three milliseconds, one must write 12.003, which the conversion treats as 12 + 0.003 = 12.003 seconds.
第一点:众所周知,timestamp数据类型最细粒度到微秒(us),也就是timestamp(6)
那么
postgres=# create table abc_s.test_lei (c1 timestamp(7)); warning: timestamp(7) precision reduced to maximum allowed, 6 第1行create table abc_s.test_lei (c1 timestamp(7)); ^ warning: timestamp(7) precision reduced to maximum allowed, 6 create table postgres=#
那么如上的语句虽然报错了,但是这个表还是create成功了,见下:
第二点:
sql语句中想插入400毫秒,就要写:
sql语句中想插入40毫秒,就要写:
sql语句中想插入4毫秒,就要写:
因为1000毫秒=1秒