mirror of
https://github.com/postgres/postgres.git
synced 2025-12-19 17:02:53 +03:00
Extend the date type to support infinity and -infinity, analogously to
the timestamp types. Turns out this doesn't even reduce the available range of dates, since the restriction to dates that work for Julian-date arithmetic is much tighter than the int32 range anyway. Per a longstanding TODO item.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.229 2008/10/03 15:37:18 petere Exp $ -->
|
||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.230 2008/10/14 17:12:32 tgl Exp $ -->
|
||||
|
||||
<chapter id="datatype">
|
||||
<title id="datatype-title">Data Types</title>
|
||||
@@ -2032,12 +2032,12 @@ January 8 04:05:06 1999 PST
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>infinity</literal></entry>
|
||||
<entry><type>timestamp</type></entry>
|
||||
<entry><type>date</type>, <type>timestamp</type></entry>
|
||||
<entry>later than all other time stamps</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>-infinity</literal></entry>
|
||||
<entry><type>timestamp</type></entry>
|
||||
<entry><type>date</type>, <type>timestamp</type></entry>
|
||||
<entry>earlier than all other time stamps</entry>
|
||||
</row>
|
||||
<row>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.449 2008/10/13 16:25:19 tgl Exp $ -->
|
||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.450 2008/10/14 17:12:32 tgl Exp $ -->
|
||||
|
||||
<chapter id="functions">
|
||||
<title>Functions and Operators</title>
|
||||
@@ -5912,10 +5912,18 @@ SELECT SUBSTRING('XY1234Z', 'Y*?([0-9]{1,3})');
|
||||
<entry><literal>3</literal></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><literal><function>isfinite</function>(<type>date</type>)</literal></entry>
|
||||
<entry><type>boolean</type></entry>
|
||||
<entry>Test for finite date (not +/-infinity)</entry>
|
||||
<entry><literal>isfinite(date '2001-02-16')</literal></entry>
|
||||
<entry><literal>true</literal></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><literal><function>isfinite</function>(<type>timestamp</type>)</literal></entry>
|
||||
<entry><type>boolean</type></entry>
|
||||
<entry>Test for finite time stamp (not equal to infinity)</entry>
|
||||
<entry>Test for finite time stamp (not +/-infinity)</entry>
|
||||
<entry><literal>isfinite(timestamp '2001-02-16 21:28:30')</literal></entry>
|
||||
<entry><literal>true</literal></entry>
|
||||
</row>
|
||||
|
||||
Reference in New Issue
Block a user