Re: Variable length varlena headers redux - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Variable length varlena headers redux
Date
Msg-id 305.1171381721@sss.pgh.pa.us
Whole thread Raw
In response to Re: Variable length varlena headers redux  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Variable length varlena headers redux  (mark@mark.mielke.cc)
List pgsql-hackers
Bruce Momjian <bruce@momjian.us> writes:
> But if you are walking through attributes, how do you know to look at
> the next byte or the next aligned byte?  We have to force zeros in
> there?

Yup: pad bytes must be zeroes (they are already) and a 1-byte-header
can't be a zero (easily done if its length includes itself).  So the
tuple-walking code would do something like
if (looking-at-a-zero && not-at-4-byte-boundary)    advance to next 4-byte boundary;check current byte to determine if
1-byteor 4-byte header;
 
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Variable length varlena headers redux
Next
From: Gregory Stark
Date:
Subject: Re: Variable length varlena headers redux