Re: Corrupt Table

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: "Bryan White" <bryan@arcamax.com>
Cc: "pgsql-general" <pgsql-general@postgreSQL.org>
Date: 2000-09-15T14:31:05Z
Lists: 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