Re: [HACKERS] Using HeapTuple.t_len to verify size of tuple

2015-08-25 Thread Vignesh Raghunathan
> > You mean "even if relacl is not null"? Sounds improbable: AFAIR, pg_class > tuples are built with heap_form_tuple, same as anything else. > > regards, tom lane I am sorry. It was a bug in my code. I did not add the size of the tuple's header field to the off variable

Re: [HACKERS] Using HeapTuple.t_len to verify size of tuple

2015-08-25 Thread Tom Lane
Vignesh Raghunathan writes: > On Tue, Aug 25, 2015 at 2:56 PM, Tom Lane wrote: >> 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. > I have modified heap_deform_tuple code to check whether the 'off' va

Re: [HACKERS] Using HeapTuple.t_len to verify size of tuple

2015-08-25 Thread Vignesh Raghunathan
On Tue, Aug 25, 2015 at 2:56 PM, Tom Lane wrote: > Vignesh Raghunathan 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

Re: [HACKERS] Using HeapTuple.t_len to verify size of tuple

2015-08-25 Thread Tom Lane
Vignesh Raghunathan 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, shoul

[HACKERS] Using HeapTuple.t_len to verify size of tuple

2015-08-25 Thread Vignesh Raghunathan
Hello, 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 sto