Re: Aggregate time data on half hour interval

Поиск
Список
Период
Сортировка
От Thomas Lockhart
Тема Re: Aggregate time data on half hour interval
Дата
Msg-id 3976957B.8BCD90F1@alumni.caltech.edu
обсуждение исходный текст
Ответ на Aggregate time data on half hour interval  (Lars <lars@sscsinc.com>)
Список pgsql-general
> In the long run it seems like date_trunc ought to be more flexible
> than it is...

Now that we can easily overload built-in functions, we should be able to
have an alternate form for date_trunc() which can do this. Say, by
accepting a double value as the first argument, which would be the
amount to round, in seconds, like this:

  date_trunc(20.0, tsfield)

or by adding one more argument which would be the units, like this:

  date_trunc('minutes', 20.0, tsfield)

I think I like this second one better.

Or are you proposing something specific for the current date_trunc()?
The current form is modeled on the Ingres function of the same name.

                 - Thomas

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Aggregate time data on half hour interval
Следующее
От: Lars
Дата:
Сообщение: Re: Aggregate time data on half hour interval