I was wondering if Postgres will be handling the unix epoch problem coming in 2038? I have read about this and am wondering.
It's about a productivity thing obviously because it is so far away, but I am curious.
dbmspostgresql
I was wondering if Postgres will be handling the unix epoch problem coming in 2038? I have read about this and am wondering.
It's about a productivity thing obviously because it is so far away, but I am curious.
Best Answer
If you look at https://www.postgresql.org/docs/11/functions-datetime.html in the documentation it displays data about the
to_timestamp
function that returns atimestamp with time zone
value from an epoch value. Complete description is: "Convert Unix epoch (seconds since 1970-01-01 00:00:00+00) to timestamp"The input type of the function is
double precision
.From https://www.postgresql.org/docs/11/datatype-numeric.html you can see that
double precision
is defined as8 bytes
with 15 decimal digits precision. A little down below you can read:So
1E+308
seconds after1970-01-01
should carry you far after 2038...In fact if you look at https://wiki.postgresql.org/wiki/TodoDone84, which lists all features that have been done in PostgreSQL 8.4 you can see: