| От | Tom Lane |
|---|---|
| Тема | Re: how to get Point * from datum =heap_getattr(....)? |
| Дата | |
| Msg-id | 18304.1273960059@sss.pgh.pa.us обсуждение |
| Ответ на | how to get Point * from datum =heap_getattr(....)? (sunpeng <bluevaley@gmail.com>) |
| Список | pgsql-general |
sunpeng <bluevaley@gmail.com> writes:
> 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'm not sure what the C-code type name is for geometry columns, but it's
definitely not Point --- that corresponds to the SQL type "point".
I'd suggest asking about this on the postgis mailing list.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера