summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql/operations.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/backends/postgresql/operations.py')
-rw-r--r--django/db/backends/postgresql/operations.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/django/db/backends/postgresql/operations.py b/django/db/backends/postgresql/operations.py
index 9b64615001..2130571a05 100644
--- a/django/db/backends/postgresql/operations.py
+++ b/django/db/backends/postgresql/operations.py
@@ -56,6 +56,9 @@ class DatabaseOperations(BaseDatabaseOperations):
sql = "DATE_TRUNC('%s', %s)" % (lookup_type, field_name)
return sql, params
+ def time_trunc_sql(self, lookup_type, field_name):
+ return "DATE_TRUNC('%s', %s)::time" % (lookup_type, field_name)
+
def deferrable_sql(self):
return " DEFERRABLE INITIALLY DEFERRED"