Re: (Updated) Table File Format

From: Hannu Krosing <hannu(at)tm(dot)ee>
To: Michael Richards <miker(at)interchange(dot)ca>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: (Updated) Table File Format
Date: 2000-12-15 17:34:06
Message-ID: 3A3A560E.38D025DF@tm.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Richards wrote:
>
> Okay,
>
> Where would I find a definition of the tuple data? I didn't see anything
> promising in include/storage?
>
> I've found a definition for the page inside pagebuf.h That clears up all the
> page stuff. I'm still having a little trouble decoding the tuple data
> within. Hannu Krosing sent me a python script to do the extract, but having
> never seen a line of Python before in my life, I'm having a little trouble
> with the actual tuple data. I can see where the actual transaction
> visibility info is in the tuple data, but the actual data... nope. My
> program (c++) is at the point where it will create tuple objects for every
> block of "tuple" data within the page.

IIRC, the data field format for individual fields is the same as defined
in
the back-end/front-end protocol for binary cursors.

if there are any NULL fields in the record then there is a flag
somewhere in
the tuple header and a bitmap of N*32 bits (N=no_of_fields/32) for
missing .
It is possible that there is no flag and you must deduce the presence of
bitmap from the tuple-header length, im not sure which way it was.

The actual fields in a table and their order must be extracted from
pg_class
and pg_attribute tables.

------------
Hannu

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Oliver Elphick 2000-12-15 17:53:13 7.1 (current) unwanted NOT NULL constraint inserted
Previous Message Stephan Szabo 2000-12-15 17:23:19 Re: Outer joins aren't working with views