Neil Conway <neilc(at)samurai(dot)com> writes:
> Is there any reason to why DecodeInterval() is willing to accept
> multiple specifications for some time units but not others?
I'd argue that it's an oversight. I don't have a problem with adding up
the values of units that really translate to the same thing (eg,
'1 week 1 day' -> '8 days'), but I think '1 second 2 second' should
be rejected because it's almost certainly user error.
Does your patch allow '1 millisec 2 microsec', which should be allowed
by this argument? I suspect that to make it work unsurprisingly, we'd
need to allocate a distinct tmask bit to each logically distinct unit.
(Maybe shortage of tmask bits is why the code is like it is?)
regards, tom lane