Last active
April 22, 2025 21:48
-
-
Save ivansabik/d15421c0aa63ff244c28bd1f9f8d59ee to your computer and use it in GitHub Desktop.
Parse UNIX timestamp (epoch) with microsecond precision in Redshift (e.g. data generated by Debezium)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Replace hardcoded value with a column | |
-- Outputs 2025-04-21 18:14:26.308930 | |
select DATEADD( | |
microsecond, | |
1745259266308930 % 1000000, | |
timestamp 'epoch' + (1745259266308930 / 1000000) * interval '1 second' | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment