Re: Struggling with set-returning functions, seeking advice

From: Joe Conway <mail(at)joeconway(dot)com>
To: Jason Topaz <topaz(at)panix(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Struggling with set-returning functions, seeking advice
Date: 2003-07-23 15:57:38
Message-ID: 3F1EB072.7050903@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Patrick Hatcher 2003-07-23 16:00:31 Re: Need clarifications......
Previous Message M Spreij 2003-07-23 15:46:02 design/copying a bunch of records