@@ -2710,15 +2710,18 @@ P <optional> <replaceable>years</replaceable>-<replaceable>months</replaceable>-
2710
2710
</para>
2711
2711
2712
2712
<para>
2713
- In the verbose input format, and in some fields of the more compact
2714
- input formats, field values can have fractional parts; for example
2715
- <literal>'1.5 week'</literal> or <literal>'01:02:03.45'</literal>. Such input is
2716
- converted to the appropriate number of months, days, and seconds
2717
- for storage. When this would result in a fractional number of
2718
- months or days, the fraction is added to the lower-order fields
2719
- using the conversion factors 1 month = 30 days and 1 day = 24 hours.
2720
- For example, <literal>'1.5 month'</literal> becomes 1 month and 15 days.
2721
- Only seconds will ever be shown as fractional on output.
2713
+ Field values can have fractional parts: for example, <literal>'1.5
2714
+ weeks'</literal> or <literal>'01:02:03.45'</literal>. However,
2715
+ because interval internally stores only three integer units (months,
2716
+ days, microseconds), fractional units must be spilled to smaller
2717
+ units. Fractional parts of units greater than months is truncated to
2718
+ be an integer number of months, e.g. <literal>'1.5 years'</literal>
2719
+ becomes <literal>'1 year 6 mons'</literal>. Fractional parts of
2720
+ weeks and days are computed to be an integer number of days and
2721
+ microseconds, assuming 30 days per month and 24 hours per day, e.g.,
2722
+ <literal>'1.75 months'</literal> becomes <literal>1 mon 22 days
2723
+ 12:00:00</literal>. Only seconds will ever be shown as fractional
2724
+ on output.
2722
2725
</para>
2723
2726
2724
2727
<para>
@@ -2762,10 +2765,10 @@ P <optional> <replaceable>years</replaceable>-<replaceable>months</replaceable>-
2762
2765
2763
2766
<para>
2764
2767
Internally <type>interval</type> values are stored as months, days,
2765
- and seconds . This is done because the number of days in a month
2768
+ and microseconds . This is done because the number of days in a month
2766
2769
varies, and a day can have 23 or 25 hours if a daylight savings
2767
2770
time adjustment is involved. The months and days fields are integers
2768
- while the seconds field can store fractions . Because intervals are
2771
+ while the microseconds field can store fractional seconds . Because intervals are
2769
2772
usually created from constant strings or <type>timestamp</type> subtraction,
2770
2773
this storage method works well in most cases, but can cause unexpected
2771
2774
results:
0 commit comments