From: | Markus Schaber <schabi(at)logix-tt(dot)com> |
---|---|
To: | PostGIS Users Discussion <postgis-users(at)postgis(dot)refractions(dot)net> |
Cc: | PostgreSQL SQL List <pgsql-sql(at)postgresql(dot)org> |
Subject: | Re: [postgis-users] Problem using set-returning functions |
Date: | 2006-03-27 14:29:51 |
Message-ID: | 4427F6DF.7070104@logix-tt.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | John DeSoi | 2006-03-27 14:30:36 | Re: Problem using set-returning functions |
Previous Message | Markus Schaber | 2006-03-27 14:25:55 | Re: Permission to Select |