【发布时间】:2023-03-14 10:39:01
【问题描述】:
我目前正在插入/更新列上没有时区数据的随机时间戳,但 PostgreSQL 不断给我错误 ERROR: column "event_start_adj" is of type timestamp without time zone but expression is of type interval 并且提示说:HINT: You will need to rewrite or cast the expression.
我的查询:
UPDATE dashboard.event SET event_start_adj = (random() * ('2020-01-01 00:00:00'::timestamp without time zone - '2020-04-16 23:59:59'::timestamp without time zone )) WHERE event_id = 2286
任何帮助将不胜感激..
【问题讨论】:
-
这是我在我的代码中看到的尝试使用的那个,但它不起作用
标签: sql postgresql