Skip to content

Commit

Permalink
Add quarter time grain to postgresql (#1362)
Browse files Browse the repository at this point in the history
The timestamp returned is the start date of the period.

Reference:
https://www.postgresql.org/docs/9.1/static/functions-datetime.html
  • Loading branch information
xrmx authored and mistercrunch committed Oct 18, 2016
1 parent 2095095 commit 0dff6a9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions caravel/db_engine_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})"),
)

Expand Down

0 comments on commit 0dff6a9

Please sign in to comment.