Re: Understanding VARHDRSZ

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Redefined Horizons" <redefined(dot)horizons(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Understanding VARHDRSZ
Date: 2006-07-27 05:24:22
Message-ID: 29979.1153977862@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Redefined Horizons" <redefined(dot)horizons(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tomasz Ostrowski 2006-07-27 08:08:48 Re: Generating unique session ids
Previous Message Q 2006-07-27 04:49:58 Re: Problem with table slowing down - Help with EXPLAIN reqd