Dan,
Okay I'm confused.  I tried this and it worked fine in both 8.2 1.3.3
and 8.3 1.3.3

CREATE OR REPLACE FUNCTION fntestbox2d(ageom geometry)
  RETURNS box2d AS
$BODY$
DECLARE retobj box2d;
BEGIN
        retobj := ST_Extent(ageom);
        RETURN retobj;
END;$BODY$
  LANGUAGE 'plpgsql' IMMUTABLE


What are you trying to do?  the cast from box to box2d as Mark noted is
a limitation of some sort.

Thanks,
Regina  

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mark
Cave-Ayland
Sent: Friday, June 27, 2008 4:46 AM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] box2d return from function!

Dan Erikson wrote:
> Quick question here.....might be easy for someone who has done this:
> 
> I want to return an extent (box2d) from a plpgsql function.  I can 
> define "box2d" as a type within the function, but only "box" in the 
> function return type or the out variable type.  Apparently I can't
cast 
> from "box2d" to "box" either.
> 
> It is possible I am approaching this all wrong.  Is there an easier
way 
> to return the results of an extent query?
> 
> (Postgresql 8.2)
> 
> 
> Dan Erikson BNRSc
> Project Manager

Yeah, I spotted this a while back :(  Unfortunately changing it in the 
1.3.x series will probably break a lot of applications, so the earliest 
it will happen is somewhere in 1.4.


ATB,

Mark.

-- 
Mark Cave-Ayland
Sirius Corporation - The Open Source Experts
http://www.siriusit.co.uk
T: +44 870 608 0063
_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users
-----------------------------------------
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.

_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to