Re: Aggregate time data on half hour interval - Mailing list pgsql-general

From Thomas Lockhart
Subject Re: Aggregate time data on half hour interval
Date
Msg-id 3976957B.8BCD90F1@alumni.caltech.edu
Whole thread Raw
In response to Aggregate time data on half hour interval  (Lars <lars@sscsinc.com>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: Aggregate time data on half hour interval
Next
From: Lars
Date:
Subject: Re: Aggregate time data on half hour interval