←back to thread

189 points GordonS | 1 comments | | HN request time: 0.202s | source
Show context
robbiep ◴[] No.19533377[source]
I have a question, that was partially addressed in some comments in the last Timezone in Databases article earlier in the week -

What do people think about using Unix time in databases?

replies(4): >>19533555 #>>19533627 #>>19533651 #>>19535478 #
jeltz ◴[] No.19535478[source]
It is necessary if you need a higher resolution than PostgreSQL supports unless you find some extension with a custom type, but using it to save space is rarely worth it because then you make the database harder to query and risk running into the 2038 problem just to save 4 bytes per timestamp.
replies(1): >>19535767 #
minusf ◴[] No.19535767[source]
64bit Unix timestamp already exists. also it's a number of seconds, so how is it higher resolution than the postgresql timestamp?
replies(1): >>19542364 #
1. jeltz ◴[] No.19542364[source]
If you need higher than micro second resolution or if you are working with astronomical timescales. These are not common cases but some people have them.