| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера