#6332·cube

PG_SQL - Internal error: Unsupported CAST from Interval(DayTime) to Timestamp(Nanosecond, None) / Data type Interval(DayTime) not supported for binary operation 'multiply' on primitive arrays

Author: gojumpropeCreated Mar 22, 2023Updated Sep 30, 2026
Labelsapi:sql

Describe the bug Cube PG SQL unable to add interval for datetime

To Reproduce Steps to reproduce the behavior:

  1. DBeaver connect Cube postgres SQL

  2. run below query works fine select * from ( select cast('2023-03-03 00:00:00' as timestamp) - interval '1 day' startdate ) t Query Result: image

  3. run below query cause error select *, startdate - interval '1 day' from ( select cast('2023-03-03 00:00:00' as timestamp) startdate ) t Query Result: image

  4. run below query works fine select cast('2023-03-22 00:00:00' as timestamp) + (interval '1 day') * 19 Query Result: image

  5. run below query cause error select cast('2023-03-22 00:00:00' as timestamp) + (interval '1 day') * datediff(day, cast('2023-03-03 00:00:00' as timestamp), cast('2023-03-22 00:00:00' as timestamp)) Query Result: image

Expected behavior Should not cause errors and able to query

Screenshots image

image

Version: v0.32.9