Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Excerpts from sunpeng's message of vie may 14 19:15:47 -0400 2010:
> 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?

No, this is not safe.  The buffer is unpinned after heap_getnext walks
to the next buffer, and thus could be used for a different page.

-- 

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux