Re: Understanding VARHDRSZ - Mailing list pgsql-general

From Tom Lane
Subject Re: Understanding VARHDRSZ
Date
Msg-id 29979.1153977862@sss.pgh.pa.us
Whole thread Raw
In response to Understanding VARHDRSZ  ("Redefined Horizons" <redefined.horizons@gmail.com>)
List pgsql-general
"Redefined Horizons" <redefined.horizons@gmail.com> writes:
> Page 524 of the PostgreSQL 8.1 Manual, PDF Edition, has a code snippit
> that makes use of the VARHDRSZ macro. I'm trying to understand the
> purpose of this macro.

It's just a symbol for the size of the length word at the start of the
stored value.

> If this is the case, why even have the VARHDRSZ macro?

Someday, we might want to change the size of the length word (eg,
move to int8, when no one uses mere 32-bit machines anymore).  That
will be a painful undertaking in any case, but everyplace that codes
the overhead space as "VARHDRSZ" rather than "4" will be one less
place to fix.

            regards, tom lane

pgsql-general by date:

Previous
From: Q
Date:
Subject: Re: Problem with table slowing down - Help with EXPLAIN reqd
Next
From: Tomasz Ostrowski
Date:
Subject: Re: Generating unique session ids