-Infinity&的适当值Postgres中的无穷大 [英] Appropriate values for -Infinity & Infinity in Postgres

查看:148
本文介绍了-Infinity&的适当值Postgres中的无穷大的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一种情况下,我们必须提供+ infinity& Postgres DB中的-infinity?

In one of the cases we have to feed values for +infinity & -infinity in Postgres DB?

应该考虑的适当值是什么。

What should be appropriate value that should be considered.

如果没有1,然后请提出最合适的建议。

If there is not 1, then please suggest the best suited.

谢谢

推荐答案

您实际上可以将 + infinity -infinity 用于 FLOAT4 FLOAT8 (即 float double precision )数据

You can actually use +infinity and -infinity for FLOAT4 and FLOAT8 (i.e. float and double precision) data types, and for timestamps.

regress=> SELECT FLOAT8 '+infinity', FLOAT8 '-infinity';
  float8  |  float8   
----------+-----------
 Infinity | -Infinity
(1 row)

对于其他类型,请使用单独的列,类型的最小/最大值,或者(在逻辑上适当的地方)使用null。

For other types, either use a separate column, use the minimum/maximum values for the type, or (where logically appropriate) use null.

这篇关于-Infinity&的适当值Postgres中的无穷大的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆