Re: truncating timestamps on arbitrary intervals

Peter Eisentraut <peter.eisentraut@enterprisedb.com>

From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: John Naylor <john.naylor@enterprisedb.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2021-03-24T19:50:59Z
Lists: pgsql-hackers
On 24.03.21 18:58, John Naylor wrote:
>  > As a potential follow-up, should we perhaps add named arguments?  That
>  > might make the invocations easier to read, depending on taste.
> 
> I think it's quite possible some users will prefer that. All we need is 
> to add something like
> 
> proargnames => '{bin_width,input,origin}'
> 
> to the catalog, right?

right, plus some documentation adjustments perhaps

> Also, I noticed that I put in double semicolons in the new functions 
> somehow. I'll fix that as well.

I have fixed that.



Commits

  1. Disallow negative strides in date_bin()

  2. Improve behavior of date_bin with origin in the future

  3. doc: Additional documentation for date_bin

  4. Add date_bin function