Re: Corrupt Table - Mailing list pgsql-general

From Tom Lane
Subject Re: Corrupt Table
Date
Msg-id 20227.969028265@sss.pgh.pa.us
Whole thread Raw
In response to Re: Corrupt Table  ("Bryan White" <bryan@arcamax.com>)
List pgsql-general
"Bryan White" <bryan@arcamax.com> writes:
> I would still like to refine my pganal tool to look inside of tuples.  Where
> should I look to find information about the internal structure?  Is it
> parsable at some level on its own or do I have to consult the system tables
> to determine stucture.  I suspect this might get more complicated once TOAST
> is available.

The tuple layout is basically

    header
    bitmap of which fields are null
    values for non-null fields

The header is type HeapTupleHeaderData defined in
src/include/access/htup.h.  The bitmap is omitted if the header's
infomask shows the tuple contains no nulls; otherwise its length
in bits is the same as the t_natts field of the header.

The data values are uninterpretable without looking up the set of
column datatypes for the table...

            regards, tom lane

pgsql-general by date:

Previous
From: "Adam Lang"
Date:
Subject: Re: what is the equivalent of oracle's DESCRIBE table?
Next
From: Ron Peterson
Date:
Subject: Re: what is the equivalent of oracle's DESCRIBE table?