[postgis-users] Problem using set-returning functions

Obe, Regina DND\MIS robe.dnd at cityofboston.gov
Mon Mar 27 06:16:26 PST 2006

Hi Markus,

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;


-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] 
Sent: Monday, March 27, 2006 8:21 AM
To: PostGIS Users Discussion
Cc: PostgreSQL SQL List
Subject: Re: [postgis-users] Problem using set-returning functions

Hi, Regina,

Obe, Regina DND\MIS wrote:

> generate_series works I think because it is a special case - it isn't 
> really a set function even though it behaves that way sortof.

Well, dump() works as well, and it is no build-in.

As a recent thread here stated, it is how set returning functions are
expected to work as long as "adjacent tables" are not implemented.



Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in EU! www.ffii.org
postgis-users mailing list postgis-users at postgis.refractions.net

The substance of this message, including any attachments, may be
confidential, legally
privileged and/or exempt from disclosure pursuant to Massachusetts
law. It is intended
solely for the addressee. If you received this in error, please
contact the sender and
delete the material from any computer.

More information about the postgis-users mailing list