Thread: internal format of timstamp?

internal format of timstamp?

From
Lars Gustafsson
Date:
Hi,

I am trying to recover a lot of deleted rows from a database  ( pg 8.2.3 ) , not my database, I promise…..

When using the tool pgfsck I get good results, but timestamp is not implemented.

When trying to export as int8  i get   fx.  4735129360236469258   representing   december 29, 2011, 16:30

But how should I do the conversion from the numeric value to the actual timestamp ?

Regards,
Lars.

Re: internal format of timstamp?

From
Jasen Betts
Date:
On 2011-12-29, Lars Gustafsson <gumse@mac.com> wrote:
> Hi,
>
> I am trying to recover a lot of deleted rows from a database  ( pg
> 8.2.3 ) , not my database, I promise…..   

>> When using the tool pgfsck I get good results, but timestamp is not implemented.
>
> When trying to export as int8  i get   fx.  4735129360236469258   representing   december 29, 2011, 16:30  
>
> But how should I do the conversion from the numeric value to the actual timestamp ?

possibly that's a floating point timestamp try it as float8 instead of
int8.



-- 
⚂⚃ 100% natural



Re: internal format of timstamp?

From
Brent Dombrowski
Date:
On Dec 29, 2011, at 7:08 AM, Lars Gustafsson wrote:

> Hi,
>
> I am trying to recover a lot of deleted rows from a database  ( pg 8.2.3 ) , not my database, I promise…..
>
> When using the tool pgfsck I get good results, but timestamp is not implemented.
>
> When trying to export as int8  i get   fx.  4735129360236469258   representing   december 29, 2011, 16:30
>
> But how should I do the conversion from the numeric value to the actual timestamp ?
>
> Regards,
> Lars.
> --
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql

I'm not sure what the internal timestamp representation is, but I thought it went down to fractions of a second.

http://www.postgresql.org/docs/8.2/interactive/datatype-datetime.html#DATATYPE-DATETIME-INTERNALS

Brent.



Re: internal format of timstamp?

From
Steve Crawford
Date:
On 12/29/2011 12:42 PM, Jasen Betts wrote:
> On 2011-12-29, Lars Gustafsson<gumse@mac.com>  wrote:
>> Hi,
>>
>> I am trying to recover a lot of deleted rows from a database  ( pg
>> 8.2.3 ) , not my database, I promise…..
>>> When using the tool pgfsck I get good results, but timestamp is not implemented.
>> When trying to export as int8  i get   fx.  4735129360236469258   representing   december 29, 2011, 16:30
>>
>> But how should I do the conversion from the numeric value to the actual timestamp ?
> possibly that's a floating point timestamp try it as float8 instead of
> int8.
>
>
>
I am not an internals person, but suspect that your first step should be
to check pg_config to see if the server from which you are attempting to
recover data was compiled with --enable-integer-datetimes.

Cheers,
Steve