Add quarter time grain to postgresql (#1362)

The timestamp returned is the start date of the period.

Reference:
https://www.postgresql.org/docs/9.1/static/functions-datetime.html
This commit is contained in:
Riccardo Magliocchetti 2016-10-18 03:32:47 +02:00 committed by Maxime Beauchemin
parent 2095095895
commit 0dff6a9030

View File

@ -56,6 +56,7 @@ class PostgresEngineSpec(BaseEngineSpec):
Grain("day", _('day'), "DATE_TRUNC('day', {col})"),
Grain("week", _('week'), "DATE_TRUNC('week', {col})"),
Grain("month", _('month'), "DATE_TRUNC('month', {col})"),
Grain("quarter", _('quarter'), "DATE_TRUNC('quarter', {col})"),
Grain("year", _('year'), "DATE_TRUNC('year', {col})"),
)