Re: Using Epoch to save timestamps in 4 bytes?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Francisco Reyes <lists(at)stringsutils(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Using Epoch to save timestamps in 4 bytes?
Date: 2008-05-11 01:37:29
Message-ID: 9798.1210469849@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Francisco Reyes <lists(at)stringsutils(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Postgres User 2008-05-11 13:12:40 Scripting function definitions as SQL?
Previous Message Francisco Reyes 2008-05-11 00:47:11 Re: Using Epoch to save timestamps in 4 bytes?