Re: What's the prefix? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: What's the prefix?
Date
Msg-id 152580.1677464335@sss.pgh.pa.us
Whole thread Raw
In response to Re: Re: What's the prefix?  ("jacktby@gmail.com" <jacktby@gmail.com>)
List pgsql-hackers
"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



pgsql-hackers by date:

Previous
From: "jacktby@gmail.com"
Date:
Subject: Re: Re: What's the prefix?
Next
From: Jeff Davis
Date:
Subject: Re: allow meson to find ICU in non-standard localtion