Re: Procedure for feature requests?

Поиск
Список
Период
Сортировка
От Tim Landscheidt
Тема Re: Procedure for feature requests?
Дата
Msg-id m3vdi07jng.fsf@passepartout.tim-landscheidt.de
обсуждение исходный текст
Ответ на Procedure for feature requests?  (Tim Landscheidt <tim@tim-landscheidt.de>)
Ответы Re: Procedure for feature requests?  (Sam Mason <sam@samason.me.uk>)
Список pgsql-general
Sam Mason <sam@samason.me.uk> wrote:

>> > any definition of "division" I've ever been able to think of [is]
>> > ill defined

>> Yep, you would probably need some safety margin and add a
>> "WHERE" clause. I should have thought about that earlier as
>> I recently stumbled (again) over why "INTERVAL / INTERVAL"
>> was not defined.

> Not sure what you mean by a "safety margin", but I don't think it would
> help much.  Hours are defined using seconds (they're *always* 3600
> seconds long, but, say, a day isn't *always* 24 hours long) so I don't
> see what a safety margin would do.

A month can last 28 to 31 days and a year 365 to 366 days,
but for example:

| tim=# SELECT EXTRACT('epoch' FROM '1 month'::INTERVAL) / 60.0 / 60 / 24;
|  ?column?
| ----------
|        30
| (1 Zeile)

| tim=#

You would have to adjust the result of "(EXTRACT('epoch'
FROM B) - EXTRACT('epoch' FROM A)) / EXTRACT('epoch' FROM
C)" by a factor of 31/30 (30/28? 28/30?) and then chop off
timestamps after B with a "WHERE" clause.

  JFTR: Hours can of course also be 3601 (or theoretically
3599) seconds long, but not in PostgreSQL :-).

Tim

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: auto truncate/vacuum full
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Upgrade from 8.2 to 8.3 & catching errors in functions