Re: Interval input: usec, msec

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Interval input: usec, msec
Дата
Msg-id 27724.1180363806@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Interval input: usec, msec  (Neil Conway <neilc@samurai.com>)
Ответы Re: Interval input: usec, msec  (Neil Conway <neilc@samurai.com>)
Список pgsql-patches
Neil Conway <neilc@samurai.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

В списке pgsql-patches по дате отправления:

Предыдущее
От: Neil Conway
Дата:
Сообщение: Interval input: usec, msec
Следующее
От: Neil Conway
Дата:
Сообщение: Re: Interval input: usec, msec