hi,is it dangerous to only use tuple pointer through heap_getnext()?

From: sunpeng <bluevaley(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: hi,is it dangerous to only use tuple pointer through heap_getnext()?
Date: 2010-05-14 23:15:47
Message-ID: AANLkTinff2aMXWjv4Y4WADcNShyiV8mm-ibjI-rqmVln@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

hi,i use these codes to store only pointer of tuple :
HeapTuple *tuple;
tuple = heap_getnext(pHeapScanDesc,ForwardScanDirection);
while(tuple){
//[1#]here i only store the pointer of tuple in an array for later
using,that means i don't retrive attribute data from this tuple ,is this ok?

myArray[i++]=tuple;
//then next tuple
tuple = heap_getnext(pHeapScanDesc,ForwardScanDirection);
}
at place [1#],i only store the pointer of current tuple in an array for
later using,that means i don't retrieve attribute data from this tuple ,is
this ok?
could these tuple pointers be invalid sometimes later if myArray still
reference these tuples? i know these tuples have been read into buffers in
shared memory, yet I am not sure wether these buffers be replaced or marked
invalid when myArray still points to these tuples in according buffers.
thanks a lot!

peng

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2010-05-15 01:15:34 Re: hi, is it dangerous to only use tuple pointer through heap_getnext()?
Previous Message Joao Ferreira gmail 2010-05-14 22:59:49 Re: autovacuum: 50% iowait for hours