Skip to content

Commit 7b53b45

Browse files
committed
Update interval documenation to mention the storage system used.
1 parent 2ddac94 commit 7b53b45

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

doc/src/sgml/datatype.sgml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.163 2005/10/22 19:33:57 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.164 2005/12/22 21:45:19 momjian Exp $
33
-->
44

55
<chapter id="datatype">
@@ -1841,9 +1841,20 @@ January 8 04:05:06 1999 PST
18411841
</para>
18421842

18431843
<para>
1844-
The optional precision
1845-
<replaceable>p</replaceable> should be between 0 and 6, and
1846-
defaults to the precision of the input literal.
1844+
The optional subsecond precision <replaceable>p</replaceable> should
1845+
be between 0 and 6, and defaults to the precision of the input literal.
1846+
</para>
1847+
1848+
<para>
1849+
Internally <type>interval</> values are stored as months, days,
1850+
and seconds. This is done because the number of days in a month
1851+
varies, and a day can have 23 or 25 hours if a daylight savings
1852+
time adjustment is involved. Because intervals are usually created
1853+
from constant strings or <type>timestamp</> subtraction, this
1854+
storage method works well in most cases. Functions
1855+
<function>justify_days</> and <function>justify_hours</> are
1856+
available for adjusting days and hours that overflow their normal
1857+
periods.
18471858
</para>
18481859
</sect3>
18491860

@@ -1936,7 +1947,7 @@ January 8 04:05:06 1999 PST
19361947
<literal>CURRENT_DATE</literal>, <literal>CURRENT_TIME</literal>,
19371948
<literal>CURRENT_TIMESTAMP</literal>, <literal>LOCALTIME</literal>,
19381949
<literal>LOCALTIMESTAMP</literal>. The latter four accept an
1939-
optional precision specification. (See <xref
1950+
optional subsecond precision specification. (See <xref
19401951
linkend="functions-datetime-current">.) Note however that these are
19411952
SQL functions and are <emphasis>not</> recognized as data input strings.
19421953
</para>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy