Re: Update 3 columns w/ 1 function calc 3 values? - Mailing list pgsql-sql

From Markus Schaber
Subject Re: Update 3 columns w/ 1 function calc 3 values?
Date
Msg-id 4523E319.6020502@logix-tt.com
Whole thread Raw
In response to Update 3 columns w/ 1 function calc 3 values?  (paallen@attglobal.net)
List pgsql-sql
Hi, paallen,

paallen@attglobal.net wrote:

> I am moving some of my old MS Access functions to
> plpgsql.
> 
> My function was made to return coordinates, X,Y,Z
> for a point along a curved line. 

Depending on the actual kind of data, you might want to look into the
PostgeSQL geometry types, or PostGIS for your geometric data.

> What should I do to speed this up.  What is the
> best way to update 3 columns from one function
> call.  In MSACCESS I once rig the function to
> cycle through the records with a curser but that
> was slow and would crap out due to the shear number.

It might work to mark the function as "stable", and have it return a
compound type in a subselect with an "AS foo" aliasname. Then you should
be able to address the compound's elements via foo.x, foo.y and foo.z.

Or use PostGIS, it's capable of processing 3D points.

HTH,
Markus

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

Fight against software patents in Europe! www.ffii.org
www.nosoftwarepatents.org


pgsql-sql by date:

Previous
From: "christopher wood"
Date:
Subject: Re: Assigning a timestamp without timezone to a timestamp
Next
From: Daryl Richter
Date:
Subject: Re: i have table