Re: Using HeapTuple.t_len to verify size of tuple

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Using HeapTuple.t_len to verify size of tuple
Дата
Msg-id 21367.1440539762@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Using HeapTuple.t_len to verify size of tuple  (Vignesh Raghunathan <vignesh.pgsql@gmail.com>)
Ответы Re: Using HeapTuple.t_len to verify size of tuple  (Vignesh Raghunathan <vignesh.pgsql@gmail.com>)
Список pgsql-hackers
Vignesh Raghunathan <vignesh.pgsql@gmail.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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: 9.4 broken on alpha
Следующее
От: Tom Lane
Дата:
Сообщение: Re: 9.4 broken on alpha