Re: [postgis-users] Problem using set-returning functions

Поиск
Список
Период
Сортировка
От 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 по дате отправления:

Предыдущее
От: Markus Schaber
Дата:
Сообщение: Re: Permission to Select
Следующее
От: John DeSoi
Дата:
Сообщение: Re: Problem using set-returning functions