Re: Using Epoch to save timestamps in 4 bytes? - Mailing list pgsql-general

From Tom Lane
Subject Re: Using Epoch to save timestamps in 4 bytes?
Date
Msg-id 9798.1210469849@sss.pgh.pa.us
Whole thread Raw
In response to Re: Using Epoch to save timestamps in 4 bytes?  (Francisco Reyes <lists@stringsutils.com>)
List pgsql-general
Francisco Reyes <lists@stringsutils.com> writes:
> Given that all of our dates will fall within what we can store in 4bytes,
> what would be the easiest way to use epoch as a timestamp?

Well, if you're bound and determined to create a Y2038 problem for
yourself, you could use the legacy "abstime" datatype.

Actually, that choice will blow up on you rather sooner than 2038,
since I'm sure we'll pull abstime from the system well before it
actually starts failing to represent now().  But future-proofing
doesn't seem to be part of your design goals, so you might as well
use it while it's there.

            regards, tom lane

pgsql-general by date:

Previous
From: Francisco Reyes
Date:
Subject: Re: Using Epoch to save timestamps in 4 bytes?
Next
From: "Postgres User"
Date:
Subject: Scripting function definitions as SQL?