Forum OpenACS Q&A: PL/R for PostgreSQL

Collapse
6: PL/R for PostgreSQL (response to 1)
Posted by Andrew Piskorski on
An update: Joe Conway <mail@joeconway.com> said on the Postgres hackers list that he's about to release PL/R, an implementation of R as a PosgreSQL procedural language.

This is similar to but different than Duncan Lang's earier work Embedding R in Postgres. In addition to the Postgres hackers email above, Joe also had this to add about PL/R:

You might say it was inspired by Duncan's work, but not really related/derived from it. He approached the problem from a very "R centric" point of view, and I from a very "PostgreSQL centric" point of view (not surprising given our respective backgrounds). PL/R does however rely on R's ability to be embedded as a shared library, and I believe Duncan was the primary driver of that (based on what I've found browsing around).
Collapse
9: Re: PL/R for PostgreSQL (response to 6)
Posted by Andrew Piskorski on
More PL/R links: PL/R homepage, and page on GBorg.
Collapse
10: Re: PL/R for PostgreSQL (response to 9)
Posted by Cheng-Yi Hsu on
I have create a nsR.c module for aolserver with limit function, since R can compile as a share library, so I can provide loadable module for aolserver. Now I can call R function from tcl. I do not have enough resource to develop the module, if anyone feel interesting , you can take the source code an continue improve it. you can ferform function call like this:
set x [nsR log1p 1.5]
set x [nsR expml 2]
set x [nsR gamma 10]

Collapse
11: Re: PL/R for PostgreSQL (response to 10)
Posted by Andrew Piskorski on
Cheng-Yi, that's interesting. I don't think I'll have the need or time to play with your nsR.c stuff anytime soon, but maybe you can upload it to file-storage or something in case others are interested?

Btw, what did you do about thread safety? Last I heard I thought R was not thread-safe, but maybe it is now?

Collapse
12: Re: PL/R for PostgreSQL (response to 11)
Posted by Cheng-Yi Hsu on
In fact, what I do is just a POC, I follow the document Writing R Extensions and AOLserver C Module Example , R provide many numerical/stat function for C and FORTRAN program , maybe R was not thread-safe, but I "guess" the function call are thread-safe. This is the first step, what I need is pass a tcl list to nsR, and do some plotting job and return the image without fork a new R process.