Re: file signature for files that make up postgres database

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Lee Duynslager <lee(dot)duynslager(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: file signature for files that make up postgres database
Date: 2011-03-03 22:28:47
Message-ID: 8965.1299191327@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Lee Duynslager <lee(dot)duynslager(at)gmail(dot)com> writes:
> Hi I am trying to recover a postgres database from a ext3 partition
> that the filesystem has become corrupt and lost files. Can anybody
> tell me what are the file signatures for the files that comprise a
> postgres database?

Look at PageHeaderIsValid in bufpage.c. Those tests are pretty weak if
only applied once, but if you got matches on the first ten or twenty 8K
pages of a file, you could probably conclude it was a PG file with high
confidence.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-03-03 22:52:42 Re: Quick Extensions Question
Previous Message David E. Wheeler 2011-03-03 22:27:49 Re: Quick Extensions Question