Vignesh Raghunathan <vignesh(dot)pgsql(at)gmail(dot)com> writes:
> Can the t_len field in HeapTuple structure be used to verify the length of
> the tuple?
> That is, if I calculate the length from the contents of the tuple using
> data from pg_attribute for fixed length fields and the data from the header
> for varlena fields, should it always match the value stored in t_len?
If t_len were *less* than that, it would be a bug. But I think it's
fairly common for t_len to be rounded up to the next maxalign boundary.
regards, tom lane