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.


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 a timestamp 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 as 8 bytes with 15 decimal digits precision. A little down below you can read:

The double precision type typically has a range of around 1E-307 to 1E+308 with a precision of at least 15 digits.

So 1E+308 seconds after 1970-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:

Completed item: Extend timezone code to allow 64-bit values so we can represent years beyond 2038


Don't worry about it, because they have added the beyond the year 2038 support more than ten years ago (!) in 8.4 release (2009):


  • The accepted answer already contains that information. Apr 6 '20 at 5:46
  • Most of answers "already contains that information" on SO as you know, there's not reason not to give it up. And there's some other additional info in my answer, and so on...
    – Acuna
    Apr 6 '20 at 6:06
  • Be that the case then I would edit the original answer appending the additional information. Not create a new one. Apr 7 '20 at 17:28
  • Sure I could done it if it would be mine)
    – Acuna
    Apr 8 '20 at 10:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.