From 78ec1cb0277307cb6f8c12e5bd5aae0fa2cb3493 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 23 Dec 2001 20:21:37 +0000 Subject: [PATCH] Type interval takes a precision, too. --- doc/src/sgml/datatype.sgml | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml index 26eeb60c27..45d14306cc 100644 --- a/doc/src/sgml/datatype.sgml +++ b/doc/src/sgml/datatype.sgml @@ -1,5 +1,5 @@ @@ -1290,7 +1290,7 @@ SELECT b, char_length(b) FROM test2; 1 microsecond / 14 digits - interval + interval [ (p) ] for time intervals 12 bytes -178000000 years @@ -1327,14 +1327,19 @@ SELECT b, char_length(b) FROM test2; - time and timestamp both accept an - optional precision field p which - determines the number of digits retained beyond the seconds - decimal point. By default, there is no explicit bound on precision - and the actual precision is determined by the underlying double - precision floating point number used to store values in seconds + time, timestamp, and interval + accept an + optional precision value p which + specifies the number of fractional digits retained in the seconds + field. By default, there is no explicit bound on precision. The + effective limit of precision is determined by the underlying double + precision floating point number used to store values (in seconds for interval and - in seconds since 2000-01-01 for timestamp. + in seconds since 2000-01-01 for timestamp). The + useful range of p is from 0 to about + 6 for timestamp, but may be more for interval. + The system will accept p ranging from + 0 to 13. @@ -1846,7 +1851,7 @@ January 8 04:05:06 1999 PST - <type>interval</type> + <type>interval [ ( <replaceable>precision</replaceable> ) ]</type> interval @@ -1860,7 +1865,7 @@ January 8 04:05:06 1999 PST @ Quantity Unit [Quantity Unit...] [Direction] - where: Quantity is an integer (possibly signed); + where: Quantity is a number (possibly signed), Unit is second, minute, hour, day, week, month, year, @@ -1877,6 +1882,12 @@ January 8 04:05:06 1999 PST explicit unit markings. For example, '1 12:59:10' is read the same as '1 day 12 hours 59 min 10 sec'. + + + The optional precision + p should be between 0 and 13, and + defaults to the precision of the input literal. + -- 2.40.0