Re:Working with Postgres Types
by agent327 on Sunday August 08, 2021 @09:59AM
(#28106749)
Seconded. I now store timestamps as the number of microseconds since the epoch. It may not be as fancy as an actual timestamp type, but at least it works without surprises.
[ Parent
| on HN ]
Re:Working with Postgres Types
by doctor_eval on Monday August 09, 2021 @08:26AM
(#28115896)
I went down this path for a time and I recommended it for MySQL some time ago. But actually epoch time and timestamptz are equivalent. You can specify the number of decimals in a timestamptz to get to microsecond precision if you like.
Except you have no idea when if you look at the database manually.