Thread: Viewing table data only from its corresponding oid-named file

Viewing table data only from its corresponding oid-named file

From
Heiner Vega Thames
Date:
<small><font face="Courier New, Courier, monospace">Hi Guys<br /><br /> I have some files that were part of a database,
Imean they were under /<b>data/base/DB_OID/table_oid</b> postgres structure<br /><br /> As I understand <b>table_oid
</b>whichis a numbered file corresponds to one table in the original database.<br /><br /> Here is my question: Is
therea tool/method to view the data in this file so I can get a clue of what the data in that table was?<br /><br /> We
hada major drive crash and we could recover only a few of those files and want to know if we have a chance to recover
somedata only from those kind of files.<br /><br /> Thanks in advance.<br /><br /> --<br /> Heiner
Vega</font></small><br/> 

Re: Viewing table data only from its corresponding oid-named file

From
Alvaro Herrera
Date:
Heiner Vega Thames escribió:
> Hi Guys
> 
> I have some files that were part of a database, I mean they were
> under /*data/base/DB_OID/table_oid* postgres structure
> 
> As I understand *table_oid *which is a numbered file corresponds to
> one table in the original database.
> 
> Here is my question: Is there a tool/method to view the data in this
> file so I can get a clue of what the data in that table was?
> 
> We had a major drive crash and we could recover only a few of those
> files and want to know if we have a chance to recover some data only
> from those kind of files.

It's rather difficult.  Try pgfsck and/or pg_filedump.  Decoding the
data in them may be very hard -- if you are able to reconstruct the
tables with all columns, it might work, but it will still be very
difficult.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support