"jacktby@gmail.com" <jacktby@gmail.com> writes:
>> text is variable length so there is header information built into the datatype representation that indicates how
longthe content is.
David's statement is accurate.
> No, this is the varlena struct:
> struct varlena
> {
> char vl_len_[4]; /* Do not touch this field directly! */
> char vl_dat[FLEXIBLE_ARRAY_MEMBER]; /* Data content is here */
This struct only accurately describes "untoasted" varlenas.
The one you are looking at is a "short header" varlena;
see varattrib_1b and nearby comments in src/include/varatt.h,
or in postgres.h if you're not looking at current HEAD branch.
regards, tom lane