datafold / data-diff

Compare tables within or across databases

Home Page:https://docs.datafold.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

dlawin opened this issue · comments

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'