Search Postgresql Archives

Re: Using Epoch to save timestamps in 4 bytes?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 9, 2008 at 3:15 AM, Scott Marlowe <scott.marlowe@xxxxxxxxx> wrote:
> On Thu, May 8, 2008 at 10:00 PM, Bruce Momjian <bruce@xxxxxxxxxx> wrote:
>>
>>  Our timestamp has a much larger range than a 4-byte time_t, docs say:
>>
>>         <entry>4713 BC</entry>
>>         <entry>294276 AD</entry>
>
> Which is normally great.  Doesn't it have greater precision in the
> modern era or something like that?
>
> If you compile for integer dates do they have the same range?

no. that's actually the integer range.  the float range is 4713 BC to
5874897 AD.   Of course, at the outer ranges of the scale, the
precision is going to be really lousy.

Anyways, to the OP, a 4 byte time_t is to small a type to be the
timestamp.  There are just too many things that need greater
range/precision to make it the default.  Also, postgresql does not
store epoch, but it's own custom type with its own bias, etc.  There
is nothing wrong with storing int4 epoch in your tables to save a
little space if that suits your application.

merlin


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux