> 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