On Sun, Jul 25, 2021 at 11:56:54AM -0700, Bryn Llewellyn wrote: > As far as I’ve been able, the PG documentation doesn’t do a good job of > defining the semantics of any of these operations. Some (like the “justify”
This is because fractional interval values are not used or asked about often. > functions” are sketched reasonably well. Others, like interval multiplication, > are entirely undefined. Yes, the “justify” functions were requested and implemented because they met a frequently-requested need unrelated to fractional values, though they do have spill-up uses. > This makes discussion of simple test like the two I showed immediately above > hard. It also makes any discussion of correctness, possible bugs, and proposed > implementation changes very difficult. Agreed. With fractional values an edge use-case, we are trying to find the most useful implementation. > As I’ve said, my conclusion is that the only safe approach is to create and > use > only “pure” interval values (where just one of the internal fields is > non-zero). For this reason (and having seen what I decided was the impossibly > unmemorable rules that my modeled implementation uses) I didn’t look at the > rules for the other fields that the interval literal allows (weeks, centuries, > millennia, and so on). I think the current page is clear about _specifying_ fractional units, but you are right that multiplication/division of fractional values is not covered. -- Bruce Momjian <br...@momjian.us> https://momjian.us EDB https://enterprisedb.com If only the physical world exists, free will is an illusion.