datafold/data-diff

Redshift normalize_timestamp - Output timestamp out of range in EXTRACT()

dlawin opened this issue · 0 comments

dlawin commented

Describe the bug
This method's reliance on extract epoch is causing an exception with timestamps that have relatively high or low values

e.g.
select extract(epoch from '0001-01-01 12:34:56.123456'::timestamp(6))
select extract(epoch from '4713-01-01 00:00:00.000000'::timestamp(6))

cause:

SQL Error [XX000]: ERROR: Overflow or underflow for DATEPART/EXTRACT 'epoch'