gpt4 book ai didi

postgresql - PostgreSql 中的 abstime 和 reltime 有什么区别

转载 作者:行者123 更新时间:2023-11-29 12:56:13 26 4
gpt4 key购买 nike

我在 pgAdmin 中偶然发现了这两种数据类型,但无法弄清楚它们在 PostgreSql 中的用途和区别。有人可以解释一下

之间的区别吗

绝对时间和实时时间

最佳答案

abstime 存储日期。reltime 存储日期之间的差异。

它们都已弃用。不要使用它们:

The types abstime and reltime are lower precision types which are used internally. You are discouraged from using these types in applications; these internal types might disappear in a future release.

source

改用 timestampinterval,它们是未弃用的等效项。

interval 数据类型可用于计算时间:

select now() - interval '1 year 2 months 4 days'; 

关于postgresql - PostgreSql 中的 abstime 和 reltime 有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42690609/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com