Re: truncating timestamps on arbitrary intervals
John Naylor <john.naylor@2ndquadrant.com>
From: John Naylor <john.naylor@2ndquadrant.com>
To: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2020-06-30T04:34:22Z
Lists: pgsql-hackers
Attachments
- v9-datetrunc-interval.patch (application/octet-stream) patch v9
In v9, I've simplified the patch somewhat to make it easier for future work to build on. - When truncating on month-or-greater intervals, require the origin to align on month. This removes the need to handle weird corner cases that have no straightforward behavior. - Remove hackish and possibly broken code to allow origin to be after the input timestamp. The default origin is Jan 1, 1 AD, so only AD dates will behave correctly by default. This is not enforced for now, since it may be desirable to find a way to get this to work in a nicer way. - Rebase docs over PG13 formatting changes. -- John Naylor https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
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