SQL标准中包含无穷大吗?

时间:2021-11-13 16:55:44

In postgres, date/time types have a special value infinity or -infinity. Are those standard SQL values, or is this a postgres addition?

在postgres中,日期/时间类型有一个特殊的值∞或-∞。这些是标准的SQL值,还是postgres添加的?

3 个解决方案

#1


5  

It is a PostgreSQL addition.

这是一个PostgreSQL添加。

The standard time range starts at 0001-01-01 00:00:00.000000 and ends at 9999-12-31 23:59:59.999999 (and time zones add to the fun of making that definition work).

标准时间范围从0001-01-01 00:00:00.000000开始,到9999-12-31 23:59:59.999999(时区让这个定义生效更有趣)结束。

There was a (US) Air Force contract AF251 in the late 1980s that required a 'doomsday' as a sort of temporal infinity. I'm not sure which DBMS got the contract, and whether the systems retained that concept generally. However, I think most don't.

在上世纪80年代末,美国空军签订了一份AF251合同,要求将“世界末日”视为一种暂时的无限。我不确定哪个DBMS得到了合同,以及系统是否保留了这个概念。然而,我认为大多数人不会。

#2


0  

As far as I know there is no concept of infinity in SQL. Generally if the result of an operation is higher than the storage of particular data type it will throw the exception or arithimetic overflow. Datetime doesnt have any uppler lower limit and hence the time can be percieved as ranging from -Infinity to +Infinity.

就我所知,SQL中没有无穷大的概念。通常,如果操作的结果高于特定数据类型的存储,就会抛出异常或动态溢出。Datetime没有任何向上的下限,因此时间可以被认为是从-∞到+∞。

#3


0  

If I'm not mistaken, the max value for a smalldatetime in SqlServer is 2079-06-06

如果我没弄错的话,SqlServer中的smalldatetime的最大值是2079-06-06

#1


5  

It is a PostgreSQL addition.

这是一个PostgreSQL添加。

The standard time range starts at 0001-01-01 00:00:00.000000 and ends at 9999-12-31 23:59:59.999999 (and time zones add to the fun of making that definition work).

标准时间范围从0001-01-01 00:00:00.000000开始,到9999-12-31 23:59:59.999999(时区让这个定义生效更有趣)结束。

There was a (US) Air Force contract AF251 in the late 1980s that required a 'doomsday' as a sort of temporal infinity. I'm not sure which DBMS got the contract, and whether the systems retained that concept generally. However, I think most don't.

在上世纪80年代末,美国空军签订了一份AF251合同,要求将“世界末日”视为一种暂时的无限。我不确定哪个DBMS得到了合同,以及系统是否保留了这个概念。然而,我认为大多数人不会。

#2


0  

As far as I know there is no concept of infinity in SQL. Generally if the result of an operation is higher than the storage of particular data type it will throw the exception or arithimetic overflow. Datetime doesnt have any uppler lower limit and hence the time can be percieved as ranging from -Infinity to +Infinity.

就我所知,SQL中没有无穷大的概念。通常,如果操作的结果高于特定数据类型的存储,就会抛出异常或动态溢出。Datetime没有任何向上的下限,因此时间可以被认为是从-∞到+∞。

#3


0  

If I'm not mistaken, the max value for a smalldatetime in SqlServer is 2079-06-06

如果我没弄错的话,SqlServer中的smalldatetime的最大值是2079-06-06