Re: Interval subtracting

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Interval subtracting
Дата
Msg-id 200603012018.k21KIhi22006@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: Interval subtracting  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Ответы Re: Interval subtracting  (Scott Marlowe <smarlowe@g2switchworks.com>)
Список pgsql-sql
Stephan Szabo wrote:
> > justify_days doesn't currently do anything with this result --- it
> > thinks its charter is only to reduce day components that are >= 30 days.
> > However, I think a good case could be made that it should normalize
> > negative days too; that is, the invariant on its result should be
> > 0 <= days < 30, not merely days < 30.
> 
> What about cases like interval '1 month -99 days', should that turn into
> interval '-3 mons +21 days' or '-2 mons -9 days'?

I think it should be the later.  It is best to have a single sign, and I
think it is possible in all cases:
'2 mons -1 days'

could be adjusted to '1 mons 29 days'.

--  Bruce Momjian   http://candle.pha.pa.us SRA OSS, Inc.   http://www.sraoss.com
 + If your life is a hard drive, Christ can be your backup. +


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

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: Replication - state of the art?
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: Interval subtracting