Re: Update 3 columns w/ 1 function calc 3 values?

From: Markus Schaber <schabi(at)logix-tt(dot)com>
To: paallen(at)attglobal(dot)net
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Update 3 columns w/ 1 function calc 3 values?
Date: 2006-10-04 16:36:41
Message-ID: 4523E319.6020502@logix-tt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi, paallen,

paallen(at)attglobal(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Daryl Richter 2006-10-04 16:37:57 Re: i have table
Previous Message christopher wood 2006-10-04 16:35:45 Re: Assigning a timestamp without timezone to a timestamp