| От | Markus Schaber |
|---|---|
| Тема | Re: [postgis-users] Problem using set-returning functions |
| Дата | |
| Msg-id | 4427F6DF.7070104@logix-tt.com обсуждение исходный текст |
| Список | pgsql-sql |
Hi, Regina, Obe, Regina DND\MIS wrote: > Actually I suspect no set returning function created in pgsql will work > the way you are trying to do it. Not sure why. The dump is done in c > and plugged in and I think it explicitly generates a tuple in the target > set for every output. > > Try rewriting your function to something like this and see if it works > > CREATE OR REPLACE FUNCTION generate_x (geom geometry) > RETURNS SETOF double precision AS > ' > SELECT X(geometryn($1,index)) > FROM generate_series(1, npoints($1)) index; > > ' LANGUAGE 'sql' IMMUTABLE STRICT; Yes, it seems to work. This will solve the OPs case. But it is still a good question whether it is possible to accomplish this using plpgsql. Thanks, Markus -- Markus Schaber | Logical Tracking&Tracing International AG Dipl. Inf. | Software Development GIS Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера