how to get Point * from datum =heap_getattr(....)? - Mailing list pgsql-general

From sunpeng
Subject how to get Point * from datum =heap_getattr(....)?
Date
Msg-id AANLkTik9q5OxaxeJDuFMk2Hfyo2f0aNyJCYoj5LPTHD2@mail.gmail.com
Whole thread Raw
Responses Re: how to get Point * from datum =heap_getattr(....)?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
hi,i have this table:
CREATE TABLE pois(
   uid integer not null,
   name VARCHAR(128),
   catcode VARCHAR(32)  not null,
   catname VARCHAR(32),
   others VARCHAR(32)
);
SELECT AddGeometryColumn('pois', 'location', 4214, 'POINT', 2);

and then in my codes,i use this invoke to get location column in tuple:
tuple = heap_getnext(pHeapScanDesc,
ForwardScanDirection);
datum = heap_getattr(tuple,6,pRawRelation->rd_att,&isnull);

then on the next,how to write to get Point? is this right?
Point *p = isnull?NULL:(Point *)(PG_DETOAST_DATUM(datum));
i've tried it,but it seems not work.

thanks a lot.

peng

pgsql-general by date:

Previous
From: "I. B."
Date:
Subject: Re: Persistence problem
Next
From: Tom Duffey
Date:
Subject: Query memory usage