Re: Attribute Alignment - Mailing list pgsql-hackers

From Michael Richards
Subject Re: Attribute Alignment
Date
Msg-id 058a01c0687d$95398770$0200a8c0@digitallis
Whole thread Raw
In response to More Tuple Madness  ("Michael Richards" <miker@interchange.ca>)
Responses Re: Attribute Alignment  ("Ross J. Reedstrom" <reedstrm@rice.edu>)
List pgsql-hackers
Okay. On this particular machine, the way I was loading in the page it
properly aligns the data to the page beginning, so I used that. I now have
it extracting meaningful data from a variety of tables. The very last thing
I need to do now is figure out where the code in the source is that stores
and retrieves timestamp and datetime fields (as I'm unsure how they are
encoded).

Having written this tool which is at least the basis for a complete table
data verification program (it's written in c++) I'm wondering if there is
any chance of having it pointed to, linked to or otherwise made available?
Time-permitting I may add to it in the future, although I hope I'll never
have to use it again :)

-Michael

> Well, it's absolute: on machines that care about such things, you *will*
> coredump if you try to fetch an int at a non-4-byte-aligned address.
>
> Our implementation forces tuple data area (also tuple header) to start
> at a MAXALIGN'd offset in the page, and we ensure that page buffers
> start at MAXALIGN'd addresses.  So the attribute access routines only
> have to worry about suitable alignment of the field's offset within the
> tuple data.  You'd get the same answer however you measured it, but
> I think the code usually does the alignment computation on the offset
> within the tuple data.
>
> regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Who is a maintainer of GiST code ?
Next
From: Hiroshi Inoue
Date:
Subject: Re: Tuple data