[HACKERS] What is the length of tuple with a TOAST pointer?

2015-09-04 Thread Vignesh Raghunathan
Hello, If a tuple has a pointer to a TOAST table entry, would the tuple's length stored in its corresponding Item include the length of the entry in the TOAST table? Thanks, Vignesh

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 t...@sss.pgh.pa.us wrote: Vignesh Raghunathan vignesh.pg...@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

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 before

[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

[HACKERS] Parsing tuple contents

2015-08-12 Thread Vignesh Raghunathan
Hello, I am working on a project which requires going through each field inside a tuple without using postgresql. I have managed to iterate through each tuple inside a table by recycling postgres's code. However, for the part of parsing through each field in the tuple, I am not able to think of

Re: [HACKERS] Parsing tuple contents

2015-08-12 Thread Vignesh Raghunathan
Thank you very much for the response. On Wed, Aug 12, 2015 at 6:31 PM, Tom Lane t...@sss.pgh.pa.us wrote: Vignesh Raghunathan vignesh.pg...@gmail.com writes: I am working on a project which requires going through each field inside a tuple without using postgresql. I have managed to iterate

[HACKERS] Caching offsets of varlena attributes

2015-08-05 Thread Vignesh Raghunathan
Hello, In the function heap_deform_tuple, there is a comment before caching varlena attributes specifying that the offset will be valid for either an aligned or unaligned value if there are no padding bytes. Could someone please elaborate on this? Also, why is it safe to call att_align_nominal