          sql = '(%s)::time' % field_name
          return sql, params
  
      def datetime_extract_sql(self, lookup_type, field_name, tzname):
          field_name, params = self._convert_field_to_tz(field_name, tzname)
          sql = self.date_extract_sql(lookup_type, field_name)
          return sql, params
  
      def datetime_trunc_sql(self, lookup_type, field_name, tzname):
          field_name, params = self._convert_field_to_tz(field_name, tzname)
          # https://www.postgresql.org/docs/current/static/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC
          sql = "DATE_TRUNC('%s', %s)" % (lookup_type, field_name)
 
</s> remove         field_name, params = self._convert_field_to_tz(field_name, tzname)
 </s> add         field_name = self._convert_field_to_tz(field_name, tzname) </s> remove         sql = "DATE_TRUNC('%s', %s)" % (lookup_type, field_name)
        return sql, params
 </s> add         return "DATE_TRUNC('%s', %s)" % (lookup_type, field_name) </s> remove         field_name, params = self._convert_field_to_tz(field_name, tzname)
        sql = '(%s)::time' % field_name
        return sql, params
 </s> add         field_name = self._convert_field_to_tz(field_name, tzname)
        return '(%s)::time' % field_name </s> remove         field_name, params = self._convert_field_to_tz(field_name, tzname)
        sql = "TIME(%s)" % field_name
        return sql, params
 </s> add         field_name = self._convert_field_to_tz(field_name, tzname)
        return "TIME(%s)" % field_name </s> remove         field_name, params = self._convert_field_to_tz(field_name, tzname)
        sql = '(%s)::date' % field_name
        return sql, params
 </s> add         field_name = self._convert_field_to_tz(field_name, tzname)
        return '(%s)::date' % field_name
        field_name = self._convert_field_to_tz(field_name, tzname)
        return self.date_extract_sql(lookup_type, field_name)
          sql = '(%s)::time' % field_name
          return sql, params
  
      def datetime_extract_sql(self, lookup_type, field_name, tzname):
        field_name = self._convert_field_to_tz(field_name, tzname)
        return self.date_extract_sql(lookup_type, field_name)
        field_name = self._convert_field_to_tz(field_name, tzname)
        return self.date_extract_sql(lookup_type, field_name)
        field_name = self._convert_field_to_tz(field_name, tzname)
        return self.date_extract_sql(lookup_type, field_name)
  
      def datetime_trunc_sql(self, lookup_type, field_name, tzname):
          field_name, params = self._convert_field_to_tz(field_name, tzname)
          # https://www.postgresql.org/docs/current/static/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC
          sql = "DATE_TRUNC('%s', %s)" % (lookup_type, field_name)
keep keep keep keep replace replace replace keep keep keep keep keep
 Fixed #27802 -- Unified return value of db backend datetime SQL methods. 
django/db/backends/postgresql/operations.py