Re: Struggling with set-returning functions, seeking advice - Mailing list pgsql-novice

From Joe Conway
Subject Re: Struggling with set-returning functions, seeking advice
Date
Msg-id 3F1EB072.7050903@joeconway.com
Whole thread Raw
In response to Struggling with set-returning functions, seeking advice  (Jason Topaz <topaz@panix.com>)
List pgsql-novice
Jason Topaz wrote:
> 3) Any recommendations for a completely different way to approach this
>    table transformation?  Incidentally, I have simplified a lot for
>    purposes of this posting, but the real application involves
> transforming
>    time-series data (stored in an array field) into a expanded table
>    where there is one row per original element in the array.
>

In addition to Tom's comments I'd add that for your real application, if
you are familiar with S-PLUS or R, you might find that it is easier to
do what you want using PL/R. The S language is a good fit if you have
arrays you need to manipulate.

I typically solve this kind of problem by passing any WHERE clause
criteria as arguments, build and execute the SQL statement, manipulate
that data, and then return just the final results via a FROM clause PL/R
function.

You can get PL/R here:
   http://www.joeconway.com/plr/

HTH,

Joe


pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: Struggling with set-returning functions, seeking advice
Next
From: "Patrick Hatcher"
Date:
Subject: Re: Need clarifications......