From: | sunpeng <bluevaley(at)gmail(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | how to get Point * from datum =heap_getattr(....)? |
Date: | 2010-05-15 17:01:13 |
Message-ID: | AANLkTiksWxOBBlZ8jG1WpPHPnIWDa_KQvf025g6K4p-n@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Treat | 2010-05-15 17:58:03 | Re: [HACKERS] List traffic |
Previous Message | Julian Mehnle | 2010-05-15 16:14:32 | Re: "--variable foo=bar" vs. "\set foo quux" in ~/.psqlrc |