Re: file signature for files that make up postgres database - Mailing list pgsql-hackers

From Tom Lane
Subject Re: file signature for files that make up postgres database
Date
Msg-id 8965.1299191327@sss.pgh.pa.us
Whole thread Raw
In response to file signature for files that make up postgres database  (Lee Duynslager <lee.duynslager@gmail.com>)
List pgsql-hackers
Lee Duynslager <lee.duynslager@gmail.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


pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: Quick Extensions Question
Next
From: Tom Lane
Date:
Subject: Re: Quick Extensions Question