On Fri, Jul 30, 2021 at 3:20 PM Bruce Momjian <bruce@momjian.us> wrote:
> Uh, what do you suggest then? You wanted the years/months fixed, and
> rounding at spill stop time makes sense, and fixes the problem.
Hmm, maybe I misunderstood. Are you saying that you think the patch
will fix cases like interval '-1.7 years 29.4 months' and interval
'29.4 months -1.7 years' to produce the same answer without changing
any other cases? I had the impression that you were proposing a bigger
change to the rules for converting fractional units to units of lower
type, particularly because Tom called it an "API change".
For some reason I can't apply the patch locally.
[rhaas pgsql]$ patch -p1 < ~/Downloads/interval.diff
(Stripping trailing CRs from patch.)
patching file doc/src/sgml/datatype.sgml
(Stripping trailing CRs from patch.)
patching file src/backend/utils/adt/datetime.c
patch: **** malformed patch at line 90: @@ -3601,7 +3597,7 @@
DecodeISO8601Interval(char *str,
--
Robert Haas
EDB: http://www.enterprisedb.com