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-04-10T11:42:57Z
Lists: pgsql-hackers
On 30.03.21 18:06, John Naylor wrote: > Currently, when the origin is after the input, the result is the > timestamp at the end of the bin, rather than the beginning as expected. > The attached puts the result consistently at the beginning of the bin. In the patch + if (origin > timestamp && stride_usecs > 1) + tm_delta -= stride_usecs; is the condition stride_usecs > 1 really necessary? My assessment is that it's not, in which case it would be better to omit it.
Commits
-
Disallow negative strides in date_bin()
- fc0d9b8c224f 14.0 landed
- 3ba70d4e1523 15.0 landed
-
Improve behavior of date_bin with origin in the future
- 496e58bb0e5e 14.0 landed
-
doc: Additional documentation for date_bin
- 49fb4e6b2490 14.0 landed
-
Add date_bin function
- 49ab61f0bdc9 14.0 landed