我ERROR: timestamp out of range: "1.52701e+15"
在尝试将存储为 bigint 的纪元转换为时间戳(值取自真实数据库表)时得到:
select to_timestamp(1527012834506374);
ERROR: timestamp out of range: "1.52701e+15"
其他转换方法也不起作用:
select 1527012834506374::abstime::timestamp;
ERROR: cannot cast type bigint to abstime
select 1527012834506374::integer::abstime::timestamp;
ERROR: integer out of range
这是一个有效的时代;https://www.epochconverter.com/告诉我 1527012834506374 相当于 2018-05-22 06:13:54.506 UTC
如何在 Postgres 中使用 SQL 进行转换?