Re: looping over a small record set over and over in a function - Mailing list pgsql-general

From Craig Ringer
Subject Re: looping over a small record set over and over in a function
Date
Msg-id 1245553071.15432.30.camel@ayaki
Whole thread Raw
In response to looping over a small record set over and over in a function  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Responses cursors, temp tables, dynamic sql technique (was and is: looping over a small record set over and over in a function)
List pgsql-general
On Fri, 2009-06-19 at 20:23 +0200, Ivan Sergio Borgonovo wrote:

> If I could easily load all the dataset into an array, loop through
> it and then just update the computed field it would be nice... but
> how?

Are you sure you _really_ need a PL/PgSQL function for this?

Can't you:

SELECT x.*, computefield(x, p)
FROM smalltable x, otherparams p;

or something along those lines?

--
Craig Ringer


pgsql-general by date:

Previous
From: Gerhard Wiesinger
Date:
Subject: Implicit conversion/comparision of timestamp with and without timezone
Next
From: Peter Eisentraut
Date:
Subject: Re: pl/sql resources for pl/pgsql?