Hi Tinh, Thanks for v4. I tested it on master (4255812efdb).
The cancellation cases from my earlier mail now work in both field orders, and the cases from the report still read back unchanged. Zsolt's example is fixed too: '01:00:00 1.5 days' and '1.5 days 01:00:00' both give 1 day 13:00:00, and the same for weeks. make check passes, also with datetime.c built with -DUSE_NATIVE_INT128=0 so NegateIntervalValue takes the struct path. The new tests fail without the datetime.c change, and pgindent is clean. I compared about 2000 generated inputs on master and v4 (IntervalStyle postgres and sql_standard). Nothing master accepts is rejected or read differently. One case outside that set does change, because of the fractional-day fix: master accepts '2562047788:00:54.775807 0.5 days' because the clock time overwrites the half day. v4 adds it and rejects the sum, as master already does for '0.5 days 2562047788:00:54.775807'. I think that's correct. Smaller notes: - Out-of-range signed time fields now get the same error as unsigned ones: '-1:60' says "interval field value out of range" (22015) instead of "invalid input syntax" (22007), like '1:60'. Repeated units go the other way, as in v2. Maybe worth a line in the commit message. - v4 applies to master and REL_19, not REL_15-18. The int128.h functions it uses exist back to 15. >From my side v4 looks good. I'll leave your question about splitting out the fractional fix to Zsolt. Regards, Ishjaap Singh
